Skip to content

Commit

Permalink
wip: fix(nvim): lsp serialization error
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanregner committed Dec 16, 2024
1 parent 021d88b commit a9d9f5e
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 62 deletions.
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
# misc
clojure-lsp = {
# https://github.com/clojure-lsp/clojure-lsp/actions/workflows/nix.yml?query=is%3Asuccess
url = "github:clojure-lsp/clojure-lsp/074aed14a4f52d0ce261b54d313ad3eee6cf46d1";
url = "github:clojure-lsp/clojure-lsp/3718eb4622b01f24687cbed560ffae7880e65566";
# inputs.nixpkgs.follows = "nixpkgs-unstable";
};
};
Expand Down
130 changes: 73 additions & 57 deletions modules/home-manager/desktop/nvim/lua/user/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -259,93 +259,107 @@ require("lazy").setup({
filetypes = { "graphql", "javascript", "javascriptreact", "typescript", "typescriptreact" },
},
harper_ls = {
["harper-ls"] = {
linters = {
sentence_capitalization = false,
spaces = false,
settings = {
["harper-ls"] = {
linters = {
sentence_capitalization = false,
spaces = false,
},
},
},
},
helm_ls = {
["helm-ls"] = {
valuesFiles = {
-- mainValuesFile = "values.yaml",
-- lintOverlayValuesFile = "values.lint.yaml",
additionalValuesFilesGlobPattern = "*values*.yaml",
},
yamlls = {
enabled = true,
diagnosticsLimit = 50,
showDiagnosticsDirectly = false,
path = "yaml-language-server",
config = {
schemas = {
kubernetes = "templates/**",
settings = {
["helm-ls"] = {
valuesFiles = {
-- mainValuesFile = "values.yaml",
-- lintOverlayValuesFile = "values.lint.yaml",
additionalValuesFilesGlobPattern = "*values*.yaml",
},
yamlls = {
enabled = true,
diagnosticsLimit = 50,
showDiagnosticsDirectly = false,
path = "yaml-language-server",
config = {
schemas = {
kubernetes = "templates/**",
},
completion = true,
hover = true,
-- any other config from https://github.com/redhat-developer/yaml-language-server#language-server-settings
},
completion = true,
hover = true,
-- any other config from https://github.com/redhat-developer/yaml-language-server#language-server-settings
},
},
},
},
html = { filetypes = { "html", "twig", "hbs" } },
jsonls = {
-- https://github.com/b0o/SchemaStore.nvim?tab=readme-ov-file
json = {
schemas = require("schemastore").json.schemas(),
validate = { enable = true },
settings = { -- https://github.com/b0o/SchemaStore.nvim?tab=readme-ov-file
json = {
schemas = require("schemastore").json.schemas(),
validate = { enable = true },
},
},
},
nil_ls = {},
nushell = {},
pyright = {},
rust_analyzer = {
-- https://rust-analyzer.github.io/manual.html#configuration
["rust-analyzer"] = {
cargo = {
allFeatures = true,
},
check = {
command = "clippy",
},
completion = {
autoimport = { enable = true },
},
files = {
excludeDirs = { ".direnv", ".git" },
settings = {
["rust-analyzer"] = {
cargo = {
allFeatures = true,
},
check = {
command = "clippy",
},
completion = {
autoimport = { enable = true },
},
files = {
excludeDirs = { ".direnv", ".git" },
},
},
},
},
terraformls = {
root_dir = util.root_pattern(".terraform", ".terraform.lock.hcl", ".git"),
},
tflint = {
root_dir = util.root_pattern(".terraform", ".terraform.lock.hcl", ".git", ".tflint.hcl"),
root_dir = util.root_pattern(".tflint.hcl", ".terraform", ".terraform.lock.hcl", ".git"),
},
vtsls = {
settings = require("vtsls").lspconfig.settings,
},
yamlls = {
yaml = {
-- https://github.com/b0o/SchemaStore.nvim?tab=readme-ov-file
schemaStore = {
-- You must disable built-in schemaStore support if you want to use
-- this plugin and its advanced options like `ignore`.
enable = false,
-- Avoid TypeError: Cannot read properties of undefined (reading 'length')
url = "",
settings = {
yaml = {
-- https://github.com/b0o/SchemaStore.nvim?tab=readme-ov-file
schemaStore = {
-- You must disable built-in schemaStore support if you want to use
-- this plugin and its advanced options like `ignore`.
enable = false,
-- Avoid TypeError: Cannot read properties of undefined (reading 'length')
url = "",
},
schemas = require("schemastore").yaml.schemas(),
},
schemas = require("schemastore").yaml.schemas(),
},
},

lua_ls = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
-- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings
-- diagnostics = { disable = { 'missing-fields' } },
settings = {
Lua = {
workspace = {
checkThirdParty = false,
ignoreDir = { ".direnv", ".git" },
},
telemetry = { enable = false },
-- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings
-- diagnostics = { disable = { 'missing-fields' } },
},
},
},
}
Expand All @@ -355,13 +369,15 @@ require("lazy").setup({
capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities())

for server_name, server_config in pairs(servers) do
vim.print(server_name, server_config.settings)
print(server_name, server_config.settings)
require("lspconfig")[server_name].setup({
cmd = server_config.cmd,
capabilities = capabilities,
-- cmd = server_config.cmd,
-- capabilities = capabilities,
on_attach = on_attach,
settings = server_config,
filetypes = server_config.filetypes,
root_dir = server_config.root_dir,
-- settings = server_config.settings,
-- filetypes = server_config.filetypes,
-- root_dir = server_config.root_dir,
})
end
end,
Expand Down

0 comments on commit a9d9f5e

Please sign in to comment.