nix.nvim/nvim/ftplugin/nix.lua

24 lines
578 B
Lua
Raw Permalink Normal View History

2024-03-06 02:24:31 +01:00
-- Exit if the language server isn't available
if vim.fn.executable('nil') ~= 1 then
return
end
local root_files = {
'flake.nix',
'default.nix',
'shell.nix',
'.git',
}
vim.lsp.start {
name = 'nil_ls',
cmd = { 'nil' },
root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]),
capabilities = require('user.lsp').make_client_capabilities(),
filetypes = { "nix" },
on_attach = function(client, bufnr)
require("nvim-navic").attach(client, bufnr)
require("workspace-diagnostics").populate_workspace_diagnostics(client, bufnr)
end,
2024-03-06 02:24:31 +01:00
}