From 8123749151160aa8606f64cdb9481ec4c14b1b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cain=C3=A3=20Costa?= Date: Tue, 24 Sep 2024 15:32:21 -0300 Subject: [PATCH] fix(lsp): properly load runtime path on lua_ls --- default.nix | 2 ++ plugins/lspconfig/configuration.lua | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/default.nix b/default.nix index 85b27ae..6152b1c 100644 --- a/default.nix +++ b/default.nix @@ -58,7 +58,9 @@ mkDerivation { wrapProgram $out/bin/nvim \ --suffix PATH : ${plugins}/bin \ + --set VIMRUNTIME ${neovim-unwrapped}/share/nvim/runtime \ --set NVIM_APPNAME nightvim \ + --set NIGHTVIM_ROOT ${plugins}/share/nightvim \ --add-flags "-u ${writeText "init.lua" initFile}" ''; diff --git a/plugins/lspconfig/configuration.lua b/plugins/lspconfig/configuration.lua index eebe450..3926462 100644 --- a/plugins/lspconfig/configuration.lua +++ b/plugins/lspconfig/configuration.lua @@ -105,23 +105,29 @@ lspconfig.ruff_lsp.setup({ lspconfig.lua_ls.setup({ settings = { Lua = { + hints = { + enable = true, + setType = true, + }, runtime = { version = "LuaJIT", - special = { reload = "require" }, + pathStrict = true, + }, + telemetry = { + enable = false, }, workspace = { + check3rdParty = false, + diagnostics = { globals = { "vim" }, }, + library = { - vim.fn.stdpath("config") .. "/lua/nightvim", - vim.fn.stdpath("config") .. "/night/plugins", + os.getenv("NIGHTVIM_ROOT") .. "/pack/nightvim/start", vim.env.VIMRUNTIME, }, }, - telemetry = { - enable = false, - }, }, }, })