[LSP] Fix errors with vtsls and format
This commit is contained in:
@@ -11,71 +11,72 @@ local on_attach_no_formatting = require("lsp-options").on_attach_no_formatting
|
|||||||
-- │ HTML, CSS, JSON │
|
-- │ HTML, CSS, JSON │
|
||||||
-- └ ┘
|
-- └ ┘
|
||||||
lsp.config("cssls", {
|
lsp.config("cssls", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
lsp.config("html", {
|
lsp.config("html", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
lsp.config("jsonls", {
|
lsp.config("jsonls", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- ┌ ┐
|
-- ┌ ┐
|
||||||
-- │ PHP │
|
-- │ PHP │
|
||||||
-- └ ┘
|
-- └ ┘
|
||||||
lsp.config("phpactor", {
|
lsp.config("phpactor", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- ┌ ┐
|
-- ┌ ┐
|
||||||
-- │ Vue │
|
-- │ Vue │
|
||||||
-- └ ┘
|
-- └ ┘
|
||||||
lsp.config("vue_ls", {
|
lsp.config("vue_ls", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach_no_formatting,
|
on_attach = on_attach_no_formatting,
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"vue",
|
"vue",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
local vue_language_server_path = vim.fn.expand("$MASON/packages")
|
local vue_language_server_path = vim.fn.expand("$MASON/packages")
|
||||||
.. "/vue-language-server"
|
.. "/vue-language-server"
|
||||||
.. "/node_modules/@vue/language-server"
|
.. "/node_modules/@vue/language-server"
|
||||||
local vue_plugin = {
|
local vue_plugin = {
|
||||||
name = "@vue/typescript-plugin",
|
name = "@vue/typescript-plugin",
|
||||||
location = vue_language_server_path,
|
location = vue_language_server_path,
|
||||||
languages = { "vue" },
|
languages = { "vue" },
|
||||||
configNamespace = "typescript",
|
configNamespace = "typescript",
|
||||||
|
enableForWorkspaceTypeScriptVersions = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- ┌ ┐
|
-- ┌ ┐
|
||||||
-- │ TS, JS, TSX, JSX │
|
-- │ TS, JS, TSX, JSX │
|
||||||
-- └ ┘
|
-- └ ┘
|
||||||
lsp.config("vtsls", {
|
lsp.config("vtsls", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach_no_formatting,
|
on_attach = on_attach_no_formatting,
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"javascript",
|
"javascript",
|
||||||
"typescript",
|
"typescript",
|
||||||
"typescriptreact",
|
"typescriptreact",
|
||||||
"javascriptreact",
|
"javascriptreact",
|
||||||
"vue",
|
"vue",
|
||||||
},
|
},
|
||||||
settings = {
|
settings = {
|
||||||
vtsls = {
|
vtsls = {
|
||||||
tsserver = {
|
tsserver = {
|
||||||
globalPlugins = {
|
globalPlugins = {
|
||||||
vue_plugin,
|
vue_plugin,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- ── Enable configs ───────────────────────────────────────────────
|
-- ── Enable configs ───────────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user