From 9ed6e64877f217e4e75cbd82e1b1e57c6e80ee65 Mon Sep 17 00:00:00 2001 From: ray-x Date: Sun, 20 Feb 2022 03:35:40 +1100 Subject: [PATCH] playground update --- playground/README.md | 2 +- playground/init.lua | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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)