summaryrefslogtreecommitdiff
path: root/lsp
diff options
context:
space:
mode:
Diffstat (limited to 'lsp')
-rw-r--r--lsp/clangd.lua30
-rw-r--r--lsp/css.lua12
-rw-r--r--lsp/go.lua18
-rw-r--r--lsp/html.lua11
-rw-r--r--lsp/javascript.lua36
-rw-r--r--lsp/json.lua8
-rw-r--r--lsp/lua.lua24
-rw-r--r--lsp/markdown.lua6
-rw-r--r--lsp/odin.lua17
-rw-r--r--lsp/ruby.lua14
-rw-r--r--lsp/yaml.lua7
-rw-r--r--lsp/zig.lua9
12 files changed, 192 insertions, 0 deletions
diff --git a/lsp/clangd.lua b/lsp/clangd.lua
new file mode 100644
index 0000000..c2deb96
--- /dev/null
+++ b/lsp/clangd.lua
@@ -0,0 +1,30 @@
+return {
+ cmd = {
+ "clangd",
+ "--header-insertion=iwyu",
+ "--background-index",
+ "--clang-tidy",
+ "--log=verbose",
+ },
+ filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
+ root_markers = {
+ ".clangd",
+ ".clang-tidy",
+ ".clang-format",
+ "compile_commands.json",
+ "compile_flags.txt",
+ "configure.ac",
+ "Makefile",
+ "CMakeLists.txt",
+ ".git",
+ },
+ single_file_support = true,
+ flags = {
+ debounce_text_changes = 20,
+ },
+ capabilities = {
+ textDocument = {
+ completion = { editsNearCursor = true }
+ },
+ }
+}
diff --git a/lsp/css.lua b/lsp/css.lua
new file mode 100644
index 0000000..01b4b77
--- /dev/null
+++ b/lsp/css.lua
@@ -0,0 +1,12 @@
+return {
+ cmd = { "vscode-css-language-server", "--stdio" },
+ filetypes = { "css", "scss", "less" },
+ root_markers = { "package.json", ".git" },
+ single_file_support = true,
+ init_options = { provideFormatter = true },
+ settings = {
+ css = { validate = true },
+ scss = { validate = true },
+ less = { validate = true },
+ },
+}
diff --git a/lsp/go.lua b/lsp/go.lua
new file mode 100644
index 0000000..e57d880
--- /dev/null
+++ b/lsp/go.lua
@@ -0,0 +1,18 @@
+return {
+ cmd = { "gopls" },
+ filetypes = { "go", "gomod", "gowork", "gosum" },
+ root_markers = { ".git" },
+ settings = {
+ autoformat = true,
+ gopls = {
+ analyses = {
+ unusedparams = true,
+ unusedwrite = true,
+ nilness = true,
+ },
+ gofumpt = true,
+ semanticTokens = true,
+ staticcheck = true,
+ },
+ },
+}
diff --git a/lsp/html.lua b/lsp/html.lua
new file mode 100644
index 0000000..f601246
--- /dev/null
+++ b/lsp/html.lua
@@ -0,0 +1,11 @@
+return {
+ cmd = { "vscode-html-language-server", "--stdio" },
+ filetypes = { "html" },
+ root_markers = { "package.json", ".git" },
+ single_file_support = true,
+ init_options = {
+ provideFormatter = true,
+ embeddedLanguages = { css = true, javascript = true },
+ configurationSection = { "html", "css", "javascript" },
+ },
+}
diff --git a/lsp/javascript.lua b/lsp/javascript.lua
new file mode 100644
index 0000000..6d8e9f8
--- /dev/null
+++ b/lsp/javascript.lua
@@ -0,0 +1,36 @@
+return {
+ cmd = {
+ "typescript-language-server",
+ "--stdio",
+ },
+ filetypes = { "javascript", "typescript" },
+ -- disable_formatting = true,
+ root_markers = { "yarn.lock", "tsconfig.json", "jsconfig.json", "package.json", ".git" },
+ single_file_support = true,
+
+ settings = {
+ javascript = {
+ inlayHints = {
+ includeInlayEnumMemberValueHints = true,
+ includeInlayFunctionLikeReturnTypeHints = true,
+ includeInlayFunctionParameterTypeHints = true,
+ includeInlayParameterNameHints = "all", -- "none" | "literals" | "all";
+ includeInlayParameterNameHintsWhenArgumentMatchesName = true,
+ includeInlayPropertyDeclarationTypeHints = true,
+ includeInlayVariableTypeHints = true,
+ },
+ },
+
+ typescript = {
+ inlayHints = {
+ includeInlayEnumMemberValueHints = true,
+ includeInlayFunctionLikeReturnTypeHints = true,
+ includeInlayFunctionParameterTypeHints = true,
+ includeInlayParameterNameHints = "all", -- "none" | "literals" | "all";
+ includeInlayParameterNameHintsWhenArgumentMatchesName = true,
+ includeInlayPropertyDeclarationTypeHints = true,
+ includeInlayVariableTypeHints = true,
+ },
+ },
+ },
+}
diff --git a/lsp/json.lua b/lsp/json.lua
new file mode 100644
index 0000000..8b2a8cf
--- /dev/null
+++ b/lsp/json.lua
@@ -0,0 +1,8 @@
+return {
+ cmd = { "vscode-json-language-server", "--stdio" },
+ filetypes = { "json", "jsonc" },
+ root_markers = { ".git" },
+ init_options = {
+ provideFormatter = true,
+ },
+}
diff --git a/lsp/lua.lua b/lsp/lua.lua
new file mode 100644
index 0000000..4d3e241
--- /dev/null
+++ b/lsp/lua.lua
@@ -0,0 +1,24 @@
+return {
+ cmd = { "lua-language-server" },
+ filetypes = { "lua" },
+ root_markers = { ".luarc.json" },
+ settings = {
+ Lua = {
+ runtime = {
+ version = "LuaJIT",
+ },
+ diagnostics = {
+ globals = {
+ "vim",
+ "require",
+ },
+ },
+ workspace = {
+ library = vim.api.nvim_get_runtime_file("", true),
+ },
+ telemetry = {
+ enable = false,
+ },
+ },
+ },
+}
diff --git a/lsp/markdown.lua b/lsp/markdown.lua
new file mode 100644
index 0000000..05fd268
--- /dev/null
+++ b/lsp/markdown.lua
@@ -0,0 +1,6 @@
+return {
+ cmd = { "marksman", "server" },
+ filetypes = { "markdown", "markdown.mdx" },
+ root_markers = { ".marksman.toml", ".git" },
+ single_file_support = true,
+}
diff --git a/lsp/odin.lua b/lsp/odin.lua
new file mode 100644
index 0000000..ee6ced4
--- /dev/null
+++ b/lsp/odin.lua
@@ -0,0 +1,17 @@
+return {
+ cmd = { "ols" },
+ filetypes = { "odin" },
+ root_markers = { "ols.json", ".git", "*.odin" },
+ single_file_support = true,
+ init_options = {
+ checker_args = "-strict-style",
+ init_options = {
+ schema = "https://raw.githubusercontent.com/DanielGavin/ols/master/misc/odinfmt.schema.json",
+ checker_args = "-strict-style",
+ enable_semantic_tokens = false,
+ enable_document_symbols = true,
+ enable_hover = true,
+ enable_snippets = true,
+ },
+ },
+}
diff --git a/lsp/ruby.lua b/lsp/ruby.lua
new file mode 100644
index 0000000..07c64a5
--- /dev/null
+++ b/lsp/ruby.lua
@@ -0,0 +1,14 @@
+return {
+ cmd = {
+ vim.fn.expand("~/.local/share/nvim/mason/bin/solargraph"),
+ "stdio",
+ },
+ filetypes = { "ruby" },
+ root_markers = { "Gemfile", ".git" },
+ init_options = { formatting = true },
+ settings = {
+ solargraph = {
+ diagnostics = true,
+ },
+ },
+}
diff --git a/lsp/yaml.lua b/lsp/yaml.lua
new file mode 100644
index 0000000..3725843
--- /dev/null
+++ b/lsp/yaml.lua
@@ -0,0 +1,7 @@
+return {
+ cmd = {
+ "yaml-language-server",
+ "--stdio",
+ },
+ filetypes = { "yaml" },
+}
diff --git a/lsp/zig.lua b/lsp/zig.lua
new file mode 100644
index 0000000..c48b2a4
--- /dev/null
+++ b/lsp/zig.lua
@@ -0,0 +1,9 @@
+return {
+ cmd = { "zls" },
+ filetypes = { "zig" },
+ root_markers = { "build.zig" },
+ single_file_support = true,
+ settings = {
+ autoformat = true,
+ },
+}