1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
local skipped_servers = {
"angularls",
"ansiblels",
"antlersls",
"ccls",
"csharp_ls",
"cssmodules_ls",
"denols",
"docker_compose_language_service",
"ember",
"emmet_ls",
"eslint",
"eslintls",
"glint",
"golangci_lint_ls",
"gradle_ls",
"graphql",
"jedi_language_server",
"ltex",
"neocmake",
"ocamlls",
"phpactor",
"psalm",
"pylsp",
"pyre",
"quick_lint_js",
"reason_ls",
"rnix",
"rome",
"ruby_ls",
"ruff_lsp",
"scry",
"solang",
"solc",
"solidity_ls",
"sorbet",
"sourcekit",
"sourcery",
"spectral",
"sqlls",
"sqls",
"stylelint_lsp",
"svlangserver",
"tflint",
"unocss",
"verible",
"vtsls",
"vuels",
}
local skipped_filetypes = { "markdown", "rst", "plaintext", "toml", "proto" }
local join_paths = require("lvim.utils").join_paths
return {
templates_dir = join_paths(get_runtime_dir(), "site", "after", "ftplugin"),
diagnostics = {
signs = {
active = true,
values = {
{ name = "DiagnosticSignError", text = lvim.icons.diagnostics.Error },
{ name = "DiagnosticSignWarn", text = lvim.icons.diagnostics.Warning },
{ name = "DiagnosticSignHint", text = lvim.icons.diagnostics.Hint },
{ name = "DiagnosticSignInfo", text = lvim.icons.diagnostics.Information },
},
},
virtual_text = true,
update_in_insert = false,
underline = true,
severity_sort = true,
float = {
focusable = true,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
},
},
document_highlight = false,
code_lens_refresh = true,
---@usage list of the keys to override behavior of the handlers
handlers = {
focusable = true,
style = "minimal",
border = "rounded",
},
on_attach_callback = nil,
on_init_callback = nil,
automatic_configuration = {
---@usage list of servers that the automatic installer will skip
skipped_servers = skipped_servers,
---@usage list of filetypes that the automatic installer will skip
skipped_filetypes = skipped_filetypes,
},
buffer_mappings = {
normal_mode = {
["K"] = { "<cmd>lua vim.lsp.buf.hover()<cr>", "Show hover" },
["gd"] = { "<cmd>lua vim.lsp.buf.definition()<cr>", "Goto definition" },
["gD"] = { "<cmd>lua vim.lsp.buf.declaration()<cr>", "Goto Declaration" },
["gr"] = { "<cmd>lua vim.lsp.buf.references()<cr>", "Goto references" },
["gI"] = { "<cmd>lua vim.lsp.buf.implementation()<cr>", "Goto Implementation" },
["gs"] = { "<cmd>lua vim.lsp.buf.signature_help()<cr>", "show signature help" },
["gl"] = {
function()
local config = vim.diagnostic.config().float
config.scope = "line"
vim.diagnostic.open_float(0, config)
end,
"Show line diagnostics",
},
},
insert_mode = {},
visual_mode = {},
},
buffer_options = {
--- enable completion triggered by <c-x><c-o>
omnifunc = "v:lua.vim.lsp.omnifunc",
--- use gq for formatting
formatexpr = "v:lua.vim.lsp.formatexpr(#{timeout_ms:500})",
},
---@usage list of settings of nvim-lsp-installer
installer = {
setup = {
ensure_installed = {},
automatic_installation = {
exclude = {},
},
},
},
nlsp_settings = {
setup = {
config_home = join_paths(get_config_dir(), "lsp-settings"),
-- set to false to overwrite schemastore.nvim
append_default_schemas = true,
ignored_servers = {},
loader = "json",
},
},
null_ls = {
setup = {
debug = false,
},
config = {},
},
---@deprecated use lvim.lsp.automatic_configuration.skipped_servers instead
override = {},
---@deprecated use lvim.lsp.installer.setup.automatic_installation instead
automatic_servers_installation = nil,
}
|