feat(lsp): refactor

* Move configs into config subdirectory
 * Move LSP logic into classes
 * Make it possible to define mason package in lsp config,
   including nested dependency resolution and post install
   steps
 * replace jedi_language_server with pylsp
This commit is contained in:
2024-04-14 15:41:39 +02:00
parent 06898a5a31
commit 2bc21b248c
17 changed files with 671 additions and 376 deletions
+40
View File
@@ -0,0 +1,40 @@
-- spec: https://github.com/eclipse/lemminx/blob/main/docs/Configuration.md
return {
enable = true,
mason = {
name = "lemminx",
-- version = "",
},
lspconfig = {
filetypes = {
"xml",
"xsd",
"xsl",
"xslt",
"svg",
},
cmd = { "lemminx", },
single_file_support = true,
init_options = {
settings = {
xml = {
format = {
enabled = true, -- is able to format document
splitAttributes = true, -- each attribute is formatted onto new line
joinCDATALines = false, -- normalize content inside CDATA
joinCommentLines = false, -- normalize content inside comments
formatComments = true, -- keep comment in relative position
joinContentLines = false, -- normalize content inside elements
spaceBeforeEmptyCloseLine = true, -- insert whitespace before self closing tag end bracket
},
validation = {
noGrammar = "ignore",
enabled = true,
schema = true,
}
},
},
},
},
}