aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2024-10-24 15:34:52 +0200
committerJustin M. Keyes <justinkz@gmail.com>2024-10-24 17:24:45 +0200
commit9624fffcfa141335f772938d8c441bdb300e04e6 (patch)
treebd6524e940d9294d48833f2a608a7aec2ebf37f5 /lua
parentdocs: update configs.md (diff)
downloadnvim-lspconfig-9624fffcfa141335f772938d8c441bdb300e04e6.tar
nvim-lspconfig-9624fffcfa141335f772938d8c441bdb300e04e6.tar.gz
nvim-lspconfig-9624fffcfa141335f772938d8c441bdb300e04e6.tar.bz2
nvim-lspconfig-9624fffcfa141335f772938d8c441bdb300e04e6.tar.lz
nvim-lspconfig-9624fffcfa141335f772938d8c441bdb300e04e6.tar.xz
nvim-lspconfig-9624fffcfa141335f772938d8c441bdb300e04e6.tar.zst
nvim-lspconfig-9624fffcfa141335f772938d8c441bdb300e04e6.zip
feat(docs): autogenerate default_config docs
Problem: Docs are manually maintained everywhere for no good reason. Solution: - revert commit 9dc02492c4a457479f8a0ec7a65aac1852ff59c0 - provide a "gF" friendly link to the source
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/configs/ada_ls.lua3
-rw-r--r--lua/lspconfig/configs/aiken.lua4
-rw-r--r--lua/lspconfig/configs/clangd.lua50
-rw-r--r--lua/lspconfig/configs/ts_ls.lua3
-rw-r--r--lua/lspconfig/configs/ttags.lua3
-rw-r--r--lua/lspconfig/configs/typeprof.lua3
-rw-r--r--lua/lspconfig/configs/uiua.lua11
-rw-r--r--lua/lspconfig/configs/wgsl_analyzer.lua3
-rw-r--r--lua/lspconfig/configs/yang_lsp.lua3
-rw-r--r--lua/lspconfig/configs/ziggy_schema.lua3
-rw-r--r--lua/lspconfig/configs/zk.lua3
-rw-r--r--lua/lspconfig/configs/zls.lua4
12 files changed, 16 insertions, 77 deletions
diff --git a/lua/lspconfig/configs/ada_ls.lua b/lua/lspconfig/configs/ada_ls.lua
index 3a8c79b0..c532f641 100644
--- a/lua/lspconfig/configs/ada_ls.lua
+++ b/lua/lspconfig/configs/ada_ls.lua
@@ -25,8 +25,5 @@ require('lspconfig').ada_ls.setup{
}
```
]],
- default_config = {
- root_dir = [[util.root_pattern("Makefile", ".git", "*.gpr", "*.adc")]],
- },
},
}
diff --git a/lua/lspconfig/configs/aiken.lua b/lua/lspconfig/configs/aiken.lua
index 8025fe1e..3c9e2562 100644
--- a/lua/lspconfig/configs/aiken.lua
+++ b/lua/lspconfig/configs/aiken.lua
@@ -17,9 +17,5 @@ A language server for Aiken Programming Language.
It can be i
]],
- default_config = {
- cmd = { 'aiken', 'lsp' },
- root_dir = [[root_pattern("aiken.toml", ".git")]],
- },
},
}
diff --git a/lua/lspconfig/configs/clangd.lua b/lua/lspconfig/configs/clangd.lua
index f5fc804d..ffee2af7 100644
--- a/lua/lspconfig/configs/clangd.lua
+++ b/lua/lspconfig/configs/clangd.lua
@@ -46,33 +46,29 @@ local function symbol_info()
end, bufnr)
end
-local root_files = {
- '.clangd',
- '.clang-tidy',
- '.clang-format',
- 'compile_commands.json',
- 'compile_flags.txt',
- 'configure.ac', -- AutoTools
-}
-
-local default_capabilities = {
- textDocument = {
- completion = {
- editsNearCursor = true,
- },
- },
- offsetEncoding = { 'utf-8', 'utf-16' },
-}
-
return {
default_config = {
cmd = { 'clangd' },
filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda', 'proto' },
root_dir = function(fname)
- return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname)
+ return util.root_pattern(
+ '.clangd',
+ '.clang-tidy',
+ '.clang-format',
+ 'compile_commands.json',
+ 'compile_flags.txt',
+ 'configure.ac' -- AutoTools
+ )(fname) or util.find_git_ancestor(fname)
end,
single_file_support = true,
- capabilities = default_capabilities,
+ capabilities = {
+ textDocument = {
+ completion = {
+ editsNearCursor = true,
+ },
+ },
+ offsetEncoding = { 'utf-8', 'utf-16' },
+ }
},
commands = {
ClangdSwitchSourceHeader = {
@@ -101,19 +97,5 @@ https://clangd.llvm.org/installation.html
- clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html)
specified as compile_commands.json, see https://clangd.llvm.org/installation#compile_commandsjson
]],
- default_config = {
- root_dir = [[
- root_pattern(
- '.clangd',
- '.clang-tidy',
- '.clang-format',
- 'compile_commands.json',
- 'compile_flags.txt',
- 'configure.ac',
- '.git'
- )
- ]],
- capabilities = [[default capabilities, with offsetEncoding utf-8]],
- },
},
}
diff --git a/lua/lspconfig/configs/ts_ls.lua b/lua/lspconfig/configs/ts_ls.lua
index 38a7c800..1eafd91b 100644
--- a/lua/lspconfig/configs/ts_ls.lua
+++ b/lua/lspconfig/configs/ts_ls.lua
@@ -83,8 +83,5 @@ require'lspconfig'.ts_ls.setup{
`filetypes` is extended here to include Vue SFC.
]],
- default_config = {
- root_dir = [[root_pattern("tsconfig.json", "jsconfig.json", "package.json", ".git")]],
- },
},
}
diff --git a/lua/lspconfig/configs/ttags.lua b/lua/lspconfig/configs/ttags.lua
index d57a7967..bbc762d5 100644
--- a/lua/lspconfig/configs/ttags.lua
+++ b/lua/lspconfig/configs/ttags.lua
@@ -10,8 +10,5 @@ return {
description = [[
https://github.com/npezza93/ttags
]],
- default_config = {
- root_dir = [[root_pattern(".git")]],
- },
},
}
diff --git a/lua/lspconfig/configs/typeprof.lua b/lua/lspconfig/configs/typeprof.lua
index ab9dc8ef..09ef2a2f 100644
--- a/lua/lspconfig/configs/typeprof.lua
+++ b/lua/lspconfig/configs/typeprof.lua
@@ -12,8 +12,5 @@ https://github.com/ruby/typeprof
`typeprof` is the built-in analysis and LSP tool for Ruby 3.1+.
]],
- default_config = {
- root_dir = [[root_pattern("Gemfile", ".git")]],
- },
},
}
diff --git a/lua/lspconfig/configs/uiua.lua b/lua/lspconfig/configs/uiua.lua
index b102f8c3..54d23ac9 100644
--- a/lua/lspconfig/configs/uiua.lua
+++ b/lua/lspconfig/configs/uiua.lua
@@ -16,16 +16,5 @@ The builtin language server of the Uiua interpreter.
The Uiua interpreter can be installed with `cargo install uiua`
]],
- default_config = {
- cmd = { 'uiua', 'lsp' },
- filetypes = { 'uiua' },
- root_dir = [[
- root_pattern(
- 'main.ua',
- 'fmt.ua',
- '.git'
- )
- ]],
- },
},
}
diff --git a/lua/lspconfig/configs/wgsl_analyzer.lua b/lua/lspconfig/configs/wgsl_analyzer.lua
index 2325cc6e..bfa2f5e9 100644
--- a/lua/lspconfig/configs/wgsl_analyzer.lua
+++ b/lua/lspconfig/configs/wgsl_analyzer.lua
@@ -16,8 +16,5 @@ https://github.com/wgsl-analyzer/wgsl-analyzer
cargo install --git https://github.com/wgsl-analyzer/wgsl-analyzer wgsl_analyzer
```
]],
- default_config = {
- root_dir = [[root_pattern(".git")]],
- },
},
}
diff --git a/lua/lspconfig/configs/yang_lsp.lua b/lua/lspconfig/configs/yang_lsp.lua
index d4c9b8b6..13f6fa35 100644
--- a/lua/lspconfig/configs/yang_lsp.lua
+++ b/lua/lspconfig/configs/yang_lsp.lua
@@ -12,8 +12,5 @@ https://github.com/TypeFox/yang-lsp
A Language Server for the YANG data modeling language.
]],
- default_config = {
- root_dir = [[util.find_git_ancestor]],
- },
},
}
diff --git a/lua/lspconfig/configs/ziggy_schema.lua b/lua/lspconfig/configs/ziggy_schema.lua
index 2bd01cc8..cd19cf35 100644
--- a/lua/lspconfig/configs/ziggy_schema.lua
+++ b/lua/lspconfig/configs/ziggy_schema.lua
@@ -14,8 +14,5 @@ https://ziggy-lang.io/documentation/ziggy-lsp/
Language server for schema files of the Ziggy data serialization format
]],
- default_config = {
- root_dir = [[util.find_git_ancestor]],
- },
},
}
diff --git a/lua/lspconfig/configs/zk.lua b/lua/lspconfig/configs/zk.lua
index 57a1ea1a..b24f1686 100644
--- a/lua/lspconfig/configs/zk.lua
+++ b/lua/lspconfig/configs/zk.lua
@@ -72,8 +72,5 @@ https://github.com/mickael-menu/zk
A plain text note-taking assistant
]],
- default_config = {
- root_dir = [[root_pattern(".zk")]],
- },
},
}
diff --git a/lua/lspconfig/configs/zls.lua b/lua/lspconfig/configs/zls.lua
index 8deeda97..540f4bd8 100644
--- a/lua/lspconfig/configs/zls.lua
+++ b/lua/lspconfig/configs/zls.lua
@@ -18,9 +18,5 @@ https://github.com/zigtools/zls
Zig LSP implementation + Zig Language Server
]],
- default_config = {
- cmd = { 'zls' },
- root_dir = [[util.root_pattern("zls.json", "build.zig", ".git")]],
- },
},
}