Skip to content

Commit

Permalink
fix(lsp): properly load runtime path on lua_ls
Browse files Browse the repository at this point in the history
  • Loading branch information
cfcosta committed Sep 24, 2024
1 parent 6fcfe98 commit 8123749
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
'';

Expand Down
18 changes: 12 additions & 6 deletions plugins/lspconfig/configuration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
},
})
Expand Down

0 comments on commit 8123749

Please sign in to comment.