vim/lsp: minor change to mason-lspconfig setup
This commit is contained in:
parent
7b4e7462b7
commit
d4660c3da4
1 changed files with 31 additions and 32 deletions
|
@ -51,44 +51,43 @@ M.config = function()
|
||||||
|
|
||||||
require('lspconfig.ui.windows').default_options = border
|
require('lspconfig.ui.windows').default_options = border
|
||||||
require('mason').setup { ui = border }
|
require('mason').setup { ui = border }
|
||||||
require('mason-lspconfig').setup()
|
require('mason-lspconfig').setup {
|
||||||
require("mason-lspconfig").setup_handlers {
|
handlers = {
|
||||||
--[[ default = ]] function(server)
|
--[[ default = ]] function(server)
|
||||||
require('lspconfig')[server].setup(opts)
|
require('lspconfig')[server].setup(opts)
|
||||||
end,
|
end,
|
||||||
|
lua_ls = function()
|
||||||
|
require('lspconfig').lua_ls.setup(extend(opts, {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
-- I'm using lua only inside neovim, so the runtime is LuaJIT.
|
||||||
|
runtime = { version = 'LuaJIT' },
|
||||||
|
|
||||||
lua_ls = function()
|
-- Get the language server to recognize the `vim` global.
|
||||||
require('lspconfig').lua_ls.setup(extend(opts, {
|
diagnostics = { globals = {'vim'} },
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
-- I'm using lua only inside neovim, so the runtime is LuaJIT.
|
|
||||||
runtime = { version = 'LuaJIT' },
|
|
||||||
|
|
||||||
-- Get the language server to recognize the `vim` global.
|
-- Make the server aware of Neovim runtime files.
|
||||||
diagnostics = { globals = {'vim'} },
|
workspace = { library = vim.api.nvim_get_runtime_file("", true) },
|
||||||
|
|
||||||
-- Make the server aware of Neovim runtime files.
|
-- Do not send telemetry data containing a randomized but unique identifier
|
||||||
workspace = { library = vim.api.nvim_get_runtime_file("", true) },
|
telemetry = { enable = false },
|
||||||
|
},
|
||||||
-- Do not send telemetry data containing a randomized but unique identifier
|
|
||||||
telemetry = { enable = false },
|
|
||||||
},
|
},
|
||||||
},
|
}))
|
||||||
}))
|
end,
|
||||||
end,
|
omnisharp = function()
|
||||||
|
require('lspconfig').omnisharp.setup(extend(opts, {
|
||||||
|
-- Show unimported types and add`using` directives.
|
||||||
|
enable_import_completion = true,
|
||||||
|
|
||||||
omnisharp = function()
|
-- Enable roslyn analyzers, code fixes, and rulesets.
|
||||||
require('lspconfig').omnisharp.setup(extend(opts, {
|
enable_roslyn_analyzers = true,
|
||||||
-- Show unimported types and add`using` directives.
|
|
||||||
enable_import_completion = true,
|
|
||||||
|
|
||||||
-- Enable roslyn analyzers, code fixes, and rulesets.
|
-- Don't include preview versions of the .NET SDK.
|
||||||
enable_roslyn_analyzers = true,
|
sdk_include_prereleases = false,
|
||||||
|
}))
|
||||||
-- Don't include preview versions of the .NET SDK.
|
end,
|
||||||
sdk_include_prereleases = false,
|
},
|
||||||
}))
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue