Skip to content

Commit

Permalink
feat(lsp): improve vuels lsp config
Browse files Browse the repository at this point in the history
  • Loading branch information
ecosse3 committed Apr 25, 2023
1 parent aa4b3fa commit e64b642
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
34 changes: 23 additions & 11 deletions lua/lsp/servers/vuels.lua
Original file line number Diff line number Diff line change
@@ -1,46 +1,58 @@
local M = {}

local on_attach = function(client, bufnr)
client.resolved_capabilities.document_formatting = false
end

M.filetypes = {
"vue"
"vue",
}

M.init_options = {
config = {
css = {},
emmet = {},
html = {
suggest = {}
suggest = {},
},
javascript = {
format = {}
format = {},
},
stylusSupremacy = {},
typescript = {
format = {}
format = {},
},
vetur = {
completion = {
autoImport = true,
tagCasing = "kebab",
useScaffoldSnippets = false
useScaffoldSnippets = false,
},
format = {
defaultFormatter = {
html = "none",
js = "none",
ts = "none"
ts = "none",
},
defaultFormatterOptions = {},
scriptInitialIndent = false,
styleInitialIndent = false
styleInitialIndent = false,
},
useWorkspaceDependencies = false,
validation = {
script = true,
style = true,
template = true
}
}
}
template = true,
templateProps = true,
interpolation = true,
},
experimental = {
templateInterpolationService = true,
},
},
},
}

M.on_attach = on_attach

return M
6 changes: 3 additions & 3 deletions lua/lsp/setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ mason_lsp.setup({
"lua_ls",
"tailwindcss",
"tsserver",
"volar",
"prismals",
},
-- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed.
Expand Down Expand Up @@ -123,10 +122,11 @@ lspconfig.vuels.setup({
filetypes = require("lsp.servers.vuels").filetypes,
handlers = handlers,
init_options = require("lsp.servers.vuels").init_options,
on_attach = on_attach,
on_attach = require("lsp.servers.vuels").on_attach,
settings = require("lsp.servers.vuels").settings,
})

for _, server in ipairs({ "bashls", "emmet_ls", "graphql", "html", "volar", "prismals" }) do
for _, server in ipairs({ "bashls", "emmet_ls", "graphql", "html", "prismals" }) do
lspconfig[server].setup({
on_attach = on_attach,
capabilities = capabilities,
Expand Down

0 comments on commit e64b642

Please sign in to comment.