nvim: mason
This commit is contained in:
parent
d60c2c7b48
commit
e6cf9b4a9d
5 changed files with 118 additions and 86 deletions
1
dot_config/nvim/after/ftplugin/xml.vim
Normal file
1
dot_config/nvim/after/ftplugin/xml.vim
Normal file
|
@ -0,0 +1 @@
|
|||
setlocal tabstop=2 shiftwidth=2
|
|
@ -1,3 +1,4 @@
|
|||
autocmd BufRead,BufNewFile Directory.Build.props set ft=xml
|
||||
autocmd BufRead,BufNewFile Directory.Build.targets set ft=xml
|
||||
autocmd BufRead,BufNewFile *.axaml set ft=xml
|
||||
autocmd BufRead,BufNewFile *.cake set filetype=cs
|
||||
|
|
|
@ -1,7 +1,18 @@
|
|||
return {
|
||||
{ 'mfussenegger/nvim-dap',
|
||||
init = function ()
|
||||
local php = require("mason-registry").get_package('php-debug-adapter')
|
||||
if not php:is_installed() then
|
||||
php:install()
|
||||
end
|
||||
end,
|
||||
|
||||
dependencies = {
|
||||
'rcarriga/nvim-dap-ui',
|
||||
'williamboman/mason.nvim',
|
||||
|
||||
|
||||
|
||||
},
|
||||
keys = {
|
||||
{ '<F2>', function() require('dap').step_over() end },
|
||||
|
@ -74,12 +85,6 @@ return {
|
|||
end
|
||||
end,
|
||||
},
|
||||
{ 'xdebug/vscode-php-debug',
|
||||
build = { 'npm install && npm run build' },
|
||||
config = false,
|
||||
module = false,
|
||||
lazy = true,
|
||||
},
|
||||
{ 'leoluz/nvim-dap-go',
|
||||
ft = 'go',
|
||||
config = true,
|
||||
|
|
|
@ -52,9 +52,9 @@ local function on_attach(args) -- {{{
|
|||
if client.server_capabilities.codeLensProvider then
|
||||
vim.api.nvim_create_autocmd(
|
||||
{ 'BufEnter', 'CursorHold', 'InsertLeave' }, {
|
||||
callback = vim.lsp.codelens.refresh,
|
||||
buffer = bufnr,
|
||||
})
|
||||
callback = vim.lsp.codelens.refresh,
|
||||
buffer = bufnr,
|
||||
})
|
||||
end
|
||||
vim.keymap.set('n', '<leader>cl', vim.lsp.codelens.run, mkOpts('LSP Run code lens'))
|
||||
vim.keymap.set('n', '<leader>ci', vim.lsp.buf.implementation, mkOpts('LSP implementation'))
|
||||
|
@ -69,8 +69,8 @@ local function on_attach(args) -- {{{
|
|||
vim.keymap.set('n', '<leader>cr', '<Cmd>Trouble lsp_references<CR>', mkOpts('LSP references'))
|
||||
vim.keymap.set(
|
||||
{ 'v', 'n' }, '<leader>F', function()
|
||||
vim.lsp.buf.format({ async = true, filter = formatting_filter })
|
||||
end,
|
||||
vim.lsp.buf.format({ async = true, filter = formatting_filter })
|
||||
end,
|
||||
mkOpts('Lsp Format')
|
||||
)
|
||||
|
||||
|
@ -82,71 +82,71 @@ local function on_attach(args) -- {{{
|
|||
client.server_capabilities.semanticTokensProvider.legend = {
|
||||
tokenModifiers = { 'static' },
|
||||
tokenTypes = {
|
||||
'comment', -- "comment",
|
||||
'comment', -- "excluded_code",
|
||||
'identifier', -- "identifier",
|
||||
'keyword', -- "keyword",
|
||||
'keyword', -- "keyword_control",
|
||||
'number', -- "number",
|
||||
'operator', -- "operator",
|
||||
'operator', -- "operator_overloaded",
|
||||
'preproc', -- "preprocessor_keyword",
|
||||
'string', -- "string",
|
||||
'whitespace', -- "whitespace",
|
||||
'text', -- "text",
|
||||
'static', -- "static_symbol",
|
||||
'preproc', -- "preprocessor_text",
|
||||
'punctuation', -- "punctuation",
|
||||
'string.escape', -- "string_verbatim",
|
||||
'comment', -- "comment",
|
||||
'comment', -- "excluded_code",
|
||||
'identifier', -- "identifier",
|
||||
'keyword', -- "keyword",
|
||||
'keyword', -- "keyword_control",
|
||||
'number', -- "number",
|
||||
'operator', -- "operator",
|
||||
'operator', -- "operator_overloaded",
|
||||
'preproc', -- "preprocessor_keyword",
|
||||
'string', -- "string",
|
||||
'whitespace', -- "whitespace",
|
||||
'text', -- "text",
|
||||
'static', -- "static_symbol",
|
||||
'preproc', -- "preprocessor_text",
|
||||
'punctuation', -- "punctuation",
|
||||
'string.escape', -- "string_verbatim",
|
||||
'character.special', -- "string_escape_character",
|
||||
'class', -- "class_name",
|
||||
'type', -- "delegate_name",
|
||||
'enum', -- "enum_name",
|
||||
'interface', -- "interface_name",
|
||||
'namespace', -- "module_name",
|
||||
'struct', -- "struct_name",
|
||||
'typeParameter', -- "type_parameter_name",
|
||||
'field', -- "field_name",
|
||||
'enumMember', -- "enum_member_name",
|
||||
'constant', -- "constant_name",
|
||||
'variable', -- "local_name",
|
||||
'parameter', -- "parameter_name",
|
||||
'method', -- "method_name",
|
||||
'method', -- "extension_method_name",
|
||||
'property', -- "property_name",
|
||||
'event', -- "event_name",
|
||||
'namespace', -- "namespace_name",
|
||||
'label', -- "label_name",
|
||||
'text.literal', -- "xml_doc_comment_attribute_name",
|
||||
'text.literal', -- "xml_doc_comment_attribute_quotes",
|
||||
'text.literal', -- "xml_doc_comment_attribute_value",
|
||||
'text.literal', -- "xml_doc_comment_cdata_section",
|
||||
'text.literal', -- "xml_doc_comment_comment",
|
||||
'text.literal', -- "xml_doc_comment_delimiter",
|
||||
'text.literal', -- "xml_doc_comment_entity_reference",
|
||||
'text.literal', -- "xml_doc_comment_name",
|
||||
'text.literal', -- "xml_doc_comment_processing_instruction",
|
||||
'text.literal', -- "xml_doc_comment_text",
|
||||
'text.literal', -- "xml_literal_attribute_name",
|
||||
'text.literal', -- "xml_literal_attribute_quotes",
|
||||
'text.literal', -- "xml_literal_attribute_value",
|
||||
'text.literal', -- "xml_literal_cdata_section",
|
||||
'text.literal', -- "xml_literal_comment",
|
||||
'text.literal', -- "xml_literal_delimiter",
|
||||
'text.literal', -- "xml_literal_embedded_expression",
|
||||
'text.literal', -- "xml_literal_entity_reference",
|
||||
'text.literal', -- "xml_literal_name",
|
||||
'text.literal', -- "xml_literal_processing_instruction",
|
||||
'text.literal', -- "xml_literal_text",
|
||||
'regexp', -- "regex_comment",
|
||||
'regexp', -- "regex_character_class",
|
||||
'regexp', -- "regex_anchor",
|
||||
'regexp', -- "regex_quantifier",
|
||||
'regexp', -- "regex_grouping",
|
||||
'regexp', -- "regex_alternation",
|
||||
'regexp', -- "regex_text",
|
||||
'regexp', -- "regex_self_escaped_character",
|
||||
'regexp' -- "regex_other_escape",
|
||||
'class', -- "class_name",
|
||||
'type', -- "delegate_name",
|
||||
'enum', -- "enum_name",
|
||||
'interface', -- "interface_name",
|
||||
'namespace', -- "module_name",
|
||||
'struct', -- "struct_name",
|
||||
'typeParameter', -- "type_parameter_name",
|
||||
'field', -- "field_name",
|
||||
'enumMember', -- "enum_member_name",
|
||||
'constant', -- "constant_name",
|
||||
'variable', -- "local_name",
|
||||
'parameter', -- "parameter_name",
|
||||
'method', -- "method_name",
|
||||
'method', -- "extension_method_name",
|
||||
'property', -- "property_name",
|
||||
'event', -- "event_name",
|
||||
'namespace', -- "namespace_name",
|
||||
'label', -- "label_name",
|
||||
'text.literal', -- "xml_doc_comment_attribute_name",
|
||||
'text.literal', -- "xml_doc_comment_attribute_quotes",
|
||||
'text.literal', -- "xml_doc_comment_attribute_value",
|
||||
'text.literal', -- "xml_doc_comment_cdata_section",
|
||||
'text.literal', -- "xml_doc_comment_comment",
|
||||
'text.literal', -- "xml_doc_comment_delimiter",
|
||||
'text.literal', -- "xml_doc_comment_entity_reference",
|
||||
'text.literal', -- "xml_doc_comment_name",
|
||||
'text.literal', -- "xml_doc_comment_processing_instruction",
|
||||
'text.literal', -- "xml_doc_comment_text",
|
||||
'text.literal', -- "xml_literal_attribute_name",
|
||||
'text.literal', -- "xml_literal_attribute_quotes",
|
||||
'text.literal', -- "xml_literal_attribute_value",
|
||||
'text.literal', -- "xml_literal_cdata_section",
|
||||
'text.literal', -- "xml_literal_comment",
|
||||
'text.literal', -- "xml_literal_delimiter",
|
||||
'text.literal', -- "xml_literal_embedded_expression",
|
||||
'text.literal', -- "xml_literal_entity_reference",
|
||||
'text.literal', -- "xml_literal_name",
|
||||
'text.literal', -- "xml_literal_processing_instruction",
|
||||
'text.literal', -- "xml_literal_text",
|
||||
'regexp', -- "regex_comment",
|
||||
'regexp', -- "regex_character_class",
|
||||
'regexp', -- "regex_anchor",
|
||||
'regexp', -- "regex_quantifier",
|
||||
'regexp', -- "regex_grouping",
|
||||
'regexp', -- "regex_alternation",
|
||||
'regexp', -- "regex_text",
|
||||
'regexp', -- "regex_self_escaped_character",
|
||||
'regexp' -- "regex_other_escape",
|
||||
},
|
||||
}
|
||||
end
|
||||
|
@ -164,7 +164,7 @@ local function config()
|
|||
-- Use a loop to conveniently both setup defined servers
|
||||
-- and map buffer local keybindings when the language server attaches
|
||||
local servers = {
|
||||
powershell_es = { bundle_path = '/home/vladimir/devel/PowerShellEditorServices/module' },
|
||||
powershell_es = {},
|
||||
gopls = {},
|
||||
clangd = {},
|
||||
zls = {},
|
||||
|
@ -212,10 +212,10 @@ local function config()
|
|||
handlers = {
|
||||
['textDocument/publishDiagnostics'] = vim.lsp.with(
|
||||
vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
virtual_text = {
|
||||
severity = vim.diagnostic.severity.ERROR,
|
||||
},
|
||||
}
|
||||
virtual_text = {
|
||||
severity = vim.diagnostic.severity.ERROR,
|
||||
},
|
||||
}
|
||||
),
|
||||
},
|
||||
root_dir = function(startpath)
|
||||
|
@ -260,18 +260,35 @@ local function config()
|
|||
}, -- }}}
|
||||
}
|
||||
|
||||
local mlsp = require('mason-lspconfig')
|
||||
local available = mlsp.get_available_servers()
|
||||
local ensure = {}
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
for name, conf in pairs(servers) do
|
||||
conf.capabilities = capabilities
|
||||
nvim_lsp[name].setup(conf)
|
||||
if vim.tbl_contains(available, name) then
|
||||
ensure[#ensure + 1] = name
|
||||
end
|
||||
end
|
||||
|
||||
mlsp.setup({ ensure_installed = ensure })
|
||||
end
|
||||
|
||||
return {
|
||||
{ 'neovim/nvim-lspconfig',
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
{ 'j-hui/fidget.nvim', config = true },
|
||||
{ 'ray-x/lsp_signature.nvim', opts = { hint_prefix = '⥊ ', floating_window = false, hint_scheme = 'Identifier' } },
|
||||
{ 'j-hui/fidget.nvim', config = true },
|
||||
{
|
||||
'ray-x/lsp_signature.nvim',
|
||||
opts = {
|
||||
hint_prefix = '⥊ ',
|
||||
floating_window = false,
|
||||
hint_scheme = 'Identifier'
|
||||
},
|
||||
},
|
||||
{ 'williamboman/mason-lspconfig.nvim' },
|
||||
},
|
||||
keys = {
|
||||
{ '<leader>li', '<Cmd>LspInfo<CR>', desc = 'Lsp info' },
|
||||
|
@ -284,4 +301,11 @@ return {
|
|||
{ 'Hoffs/omnisharp-extended-lsp.nvim', lazy = true },
|
||||
{ 'b0o/schemastore.nvim', lazy = true },
|
||||
{ 'folke/neodev.nvim', lazy = true },
|
||||
{
|
||||
'williamboman/mason.nvim',
|
||||
cmd = 'Mason',
|
||||
keys = {},
|
||||
opts = {},
|
||||
config = true,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ return {
|
|||
},
|
||||
},
|
||||
|
||||
{ 'dyng/ctrlsf.vim', cmd = 'CtrlSF' },
|
||||
{ 'dyng/ctrlsf.vim', cmd = 'CtrlSF' },
|
||||
|
||||
{ 'andymass/vim-matchup',
|
||||
event = 'BufRead',
|
||||
|
@ -113,8 +113,9 @@ return {
|
|||
end,
|
||||
},
|
||||
|
||||
{ 'fpob/nette.vim', ft = 'nette' },
|
||||
{ 'ziglang/zig.vim', ft = 'zig' },
|
||||
{ 'fpob/nette.vim', ft = 'nette' },
|
||||
{ 'ziglang/zig.vim', ft = 'zig' },
|
||||
{ 'chrisbra/csv.vim', ft = 'csv' },
|
||||
|
||||
{
|
||||
'mfussenegger/nvim-jdtls',
|
||||
|
|
Loading…
Add table
Reference in a new issue