Change to blink over cmp, improve mason so that we don't need configs
for each language server. We only override the set keys in the custom
lsp config if it exists, otherwise we rely on the default one from
lspconfig.
This commit is contained in:
parent
b195a9e22a
commit
1e18e2d419
8 changed files with 49 additions and 145 deletions
|
|
@ -1,44 +0,0 @@
|
|||
local utils = require("lspconfig.util")
|
||||
|
||||
return {
|
||||
default_config = {
|
||||
cmd = { "bash-language-server", "start" },
|
||||
settings = {
|
||||
bashIde = {
|
||||
-- Glob pattern for finding and parsing shell script files in the workspace.
|
||||
-- Used by the background analysis features across files.
|
||||
|
||||
-- Prevent recursive scanning which will cause issues when opening a file
|
||||
-- directly in the home directory (e.g. ~/foo.sh).
|
||||
--
|
||||
-- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)".
|
||||
globPattern = vim.env.GLOB_PATTERN or "**/*@(.sh|.inc|.bash|.command|.zsh|zshrc|zsh_*)",
|
||||
},
|
||||
bash = {
|
||||
format = {
|
||||
enable = true,
|
||||
shell = "shfmt",
|
||||
args = {
|
||||
"-i",
|
||||
"4",
|
||||
"-bn",
|
||||
"-ci"
|
||||
}
|
||||
},
|
||||
ignorePatterns = {
|
||||
"node_modules",
|
||||
".git"
|
||||
},
|
||||
lint = {
|
||||
enable = true
|
||||
},
|
||||
trace = {
|
||||
server = "verbose"
|
||||
},
|
||||
},
|
||||
},
|
||||
filetypes = { "sh", "zsh" },
|
||||
root_dir = utils.find_git_ancestor,
|
||||
single_file_support = true,
|
||||
},
|
||||
}
|
||||
|
|
@ -78,7 +78,7 @@ local default_capabilities = {
|
|||
editsNearCursor = true,
|
||||
},
|
||||
},
|
||||
offsetEncoding = { "utf-8", "utf-16" },
|
||||
offsetEncoding = { "utf-16" },
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
@ -101,8 +101,8 @@ return {
|
|||
return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname)
|
||||
end,
|
||||
single_file_support = true,
|
||||
capabilities = default_capabilities,
|
||||
},
|
||||
capabilities = default_capabilities,
|
||||
docs = {
|
||||
description = [[
|
||||
https://clangd.llvm.org/installation.html
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
return {
|
||||
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
return {
|
||||
on_init = function(client)
|
||||
local path = client.workspace_folders[1].name
|
||||
if not vim.loop.fs_stat(path .. "/.luarc.json") and not vim.loop.fs_stat(path .. "/.luarc.jsonc") then
|
||||
client.config.settings = vim.tbl_deep_extend("force", client.config.settings, {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using
|
||||
-- (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
},
|
||||
-- Make the server aware of Neovim runtime files
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
-- "${3rd}/luv/library"
|
||||
-- "${3rd}/busted/library",
|
||||
},
|
||||
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower
|
||||
-- library = vim.api.nvim_get_runtime_file("", true)
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
client.notify("workspace/didChangeConfiguration", { settings = client.config.settings })
|
||||
end
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
return {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue