diff --git a/playground/README.md b/playground/README.md index e929157..839e6b6 100644 --- a/playground/README.md +++ b/playground/README.md @@ -18,7 +18,7 @@ There also three folder `js`, `go`, `py`. Those folder have some basic source co The playground has js, py, go folder, so you can install either one your self in your PATH. If you want to try lua, Please check sumneko setup in init.lua make sure it pointed to correct path. By default it -potint to ~/github/sumneko +potint to ~/github/sumneko if not existed in your PATH. ## run init.lua diff --git a/playground/init.lua b/playground/init.lua index fb29b5f..0785b5b 100644 --- a/playground/init.lua +++ b/playground/init.lua @@ -10,7 +10,7 @@ local sumneko_root_path = vim.fn.expand('$HOME') .. '/github/sumneko/lua-languag local sumneko_binary = vim.fn.expand('$HOME') .. '/github/sumneko/lua-language-server/bin/macOS/lua-language-server' local lua_cfg = { - cmd = { sumneko_binary, '-E', sumneko_root_path .. '/main.lua' }, + -- cmd = { sumneko_binary, '-E', sumneko_root_path .. '/main.lua' }, settings = { Lua = { runtime = { version = 'LuaJIT', path = vim.split(package.path, ';') }, @@ -19,6 +19,10 @@ local lua_cfg = { }, } +if vim.fn.executable('lua-language-server') == 0 then + lua_cfg.cmd = { sumneko_binary, '-E', sumneko_root_path .. '/main.lua' } +end + local function load_plugins() require('packer').startup({ function(use)