aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/sumneko_lua/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-09-17 16:05:20 +0200
committerGitHub <noreply@github.com>2021-09-17 16:05:20 +0200
commit9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6 (patch)
tree58da4fff57cc3aff4380f501b1845310dff4f2e8 /lua/nvim-lsp-installer/servers/sumneko_lua/init.lua
parenttexlab: fix ensure_executables (diff)
downloadmason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.gz
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.bz2
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.lz
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.xz
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.zst
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.zip
optimize io (70%+ startup speedups) (#93)
Diffstat (limited to 'lua/nvim-lsp-installer/servers/sumneko_lua/init.lua')
-rw-r--r--lua/nvim-lsp-installer/servers/sumneko_lua/init.lua67
1 files changed, 34 insertions, 33 deletions
diff --git a/lua/nvim-lsp-installer/servers/sumneko_lua/init.lua b/lua/nvim-lsp-installer/servers/sumneko_lua/init.lua
index 696679b0..8332c0e6 100644
--- a/lua/nvim-lsp-installer/servers/sumneko_lua/init.lua
+++ b/lua/nvim-lsp-installer/servers/sumneko_lua/init.lua
@@ -4,46 +4,47 @@ local platform = require "nvim-lsp-installer.platform"
local Data = require "nvim-lsp-installer.data"
local std = require "nvim-lsp-installer.installers.std"
-local root_dir = server.get_server_root_path "sumneko_lua"
-
local bin_dir = Data.coalesce(
Data.when(platform.is_mac, "macOS"),
- Data.when(platform.is_unix, "Linux"),
+ Data.when(platform.is_linux, "Linux"),
Data.when(platform.is_win, "Windows")
)
-return server.Server:new {
- name = "sumneko_lua",
- root_dir = root_dir,
- installer = {
- std.unzip_remote "https://github.com/sumneko/vscode-lua/releases/download/v2.3.6/lua-2.3.6.vsix",
- -- see https://github.com/sumneko/vscode-lua/pull/43
- std.chmod(
- "+x",
- { "extension/server/bin/macOS/lua-language-server", "extension/server/bin/Linux/lua-language-server" }
- ),
- },
- default_options = {
- cmd = {
- path.concat { root_dir, "extension", "server", "bin", bin_dir, "lua-language-server" },
- "-E",
- path.concat { root_dir, "extension", "server", "main.lua" },
+return function(name, root_dir)
+ return server.Server:new {
+ name = name,
+ root_dir = root_dir,
+ installer = {
+ std.unzip_remote "https://github.com/sumneko/vscode-lua/releases/download/v2.3.6/lua-2.3.6.vsix",
+ -- see https://github.com/sumneko/vscode-lua/pull/43
+ std.chmod(
+ "+x",
+ { "extension/server/bin/macOS/lua-language-server", "extension/server/bin/Linux/lua-language-server" }
+ ),
},
- settings = {
- Lua = {
- diagnostics = {
- -- Get the language server to recognize the `vim` global
- globals = { "vim" },
- },
- workspace = {
- -- Make the server aware of Neovim runtime files
- library = {
- [vim.fn.expand "$VIMRUNTIME/lua"] = true,
- [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
+ default_options = {
+ cmd = {
+ -- We need to provide a _full path_ to the executable (sumneko_lua uses it to determine... things)
+ path.concat { root_dir, "extension", "server", "bin", bin_dir, "lua-language-server" },
+ "-E",
+ path.concat { root_dir, "extension", "server", "main.lua" },
+ },
+ settings = {
+ Lua = {
+ diagnostics = {
+ -- Get the language server to recognize the `vim` global
+ globals = { "vim" },
+ },
+ workspace = {
+ -- Make the server aware of Neovim runtime files
+ library = {
+ [vim.fn.expand "$VIMRUNTIME/lua"] = true,
+ [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
+ },
+ maxPreload = 10000,
},
- maxPreload = 10000,
},
},
},
- },
-}
+ }
+end