summaryrefslogtreecommitdiff
path: root/lsp
diff options
context:
space:
mode:
Diffstat (limited to 'lsp')
-rw-r--r--lsp/basedpyright.lua23
-rw-r--r--lsp/clangd.lua21
-rw-r--r--lsp/qmlls.lua5
-rw-r--r--lsp/rust-analyzer.lua25
-rw-r--r--lsp/verible.lua8
5 files changed, 82 insertions, 0 deletions
diff --git a/lsp/basedpyright.lua b/lsp/basedpyright.lua
new file mode 100644
index 0000000..79ff625
--- /dev/null
+++ b/lsp/basedpyright.lua
@@ -0,0 +1,23 @@
+return {
+ cmd = { "basedpyright-langserver", "--stdio" },
+ filetypes = { "python" },
+ root_markers = {
+ "pyrightconfig.json",
+ "pyproject.toml",
+ "setup.py",
+ "setup.cfg",
+ "requirements.txt",
+ "Pipfile",
+ ".git",
+ },
+
+ settings = {
+ basedpyright = {
+ analysis = {
+ autoSearchPaths = true,
+ useLibraryCodeForTypes = true,
+ diagnosticMode = "openFilesOnly",
+ },
+ },
+ },
+}
diff --git a/lsp/clangd.lua b/lsp/clangd.lua
new file mode 100644
index 0000000..9aced07
--- /dev/null
+++ b/lsp/clangd.lua
@@ -0,0 +1,21 @@
+return {
+ cmd = { "clangd" },
+ filetypes = { "c", "cpp", "objc", "objcpp", "cuda" },
+ root_markers = {
+ ".clangd",
+ ".clang-tidy",
+ ".clang-format",
+ "compile_commands.json",
+ "compile_flags.txt",
+ "configure.ac", -- AutoTools
+ ".git",
+ },
+ capabilities = {
+ textDocument = {
+ completion = {
+ editsNearCursor = true,
+ },
+ },
+ offsetEncoding = { "utf-8", "utf-16" },
+ },
+}
diff --git a/lsp/qmlls.lua b/lsp/qmlls.lua
new file mode 100644
index 0000000..92dc83b
--- /dev/null
+++ b/lsp/qmlls.lua
@@ -0,0 +1,5 @@
+return {
+ cmd = { "qmlls", "-E" },
+ root_markers = { ".qmlls.ini", ".git" },
+ filetypes = { "qml", "qmljs" },
+}
diff --git a/lsp/rust-analyzer.lua b/lsp/rust-analyzer.lua
index 51f5037..78ed2c5 100644
--- a/lsp/rust-analyzer.lua
+++ b/lsp/rust-analyzer.lua
@@ -1,8 +1,33 @@
+local serverReady = {}
+
return {
cmd = { "rust-analyzer" },
root_markers = { "Cargo.toml" },
filetypes = { "rust" },
+ capabilities = {
+ experimental = {
+ serverStatusNotification = true,
+ },
+ },
+
+ handlers = {
+ ["experimental/serverStatus"] = function(_, result, ctx)
+ -- Try to fix inlay hints not being shown on start of
+ if result.quiescent and not serverReady[ctx.client_id] then
+ for _, bufnr in ipairs(vim.lsp.get_buffers_by_client_id(ctx.client_id)) do
+ -- Re-enable inlay hints so they are refreshed
+ if vim.lsp.inlay_hint.is_enabled() then
+ vim.lsp.inlay_hint.enable(false, { bufnr = bufnr })
+ vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
+ end
+
+ serverReady[ctx.client_id] = true
+ end
+ end
+ end,
+ },
+
settings = {
["rust-analyzer"] = {
checkOnSave = { command = "clippy" },
diff --git a/lsp/verible.lua b/lsp/verible.lua
new file mode 100644
index 0000000..2361b8f
--- /dev/null
+++ b/lsp/verible.lua
@@ -0,0 +1,8 @@
+return {
+ cmd = { "verible-verilog-ls" },
+ filetypes = { "verilog", "systemverilog" },
+ root_markers = {
+ "verilator.f",
+ ".git",
+ },
+}