Skip to content

Commit

Permalink
add lsp config for vue, svelte, xml
Browse files Browse the repository at this point in the history
  • Loading branch information
teddywaweru committed Aug 1, 2024
1 parent 740881b commit 538d47f
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion nvim/lua/plugins/nvim_lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ return {
lazy = true,
event = "VeryLazy",
config = function()

-- Enabling built-in snippets for LSPs usinf vscode's lang servers
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
Expand All @@ -23,7 +24,29 @@ return {
require("lspconfig").clangd.setup({
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto", "mq5" }
})
require("lspconfig").tsserver.setup({})

-- local vue_language_server_path = require('mason-registry').get_package('vue-language-server'):get_install_path() ..
-- '/node_modules/@vue/language-server'

require("lspconfig").svelte.setup({})
require("lspconfig").tsserver.setup({
init_options = {
plugins = {
-- {
-- name =
-- '@vue/typescript-plugin',
-- location = vue_language_server_path,
-- languages = { 'vue' },
-- },
}
},
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' }
})

-- require("lspconfig").volar.setup({
-- capabilities = capabilities
-- })

require("lspconfig").html.setup({
capabilities = capabilities
})
Expand All @@ -33,6 +56,10 @@ return {
require("lspconfig").jsonls.setup({
capabilities = capabilities
})
require("lspconfig").lemminx.setup({
capabilities = capabilities,
filetypes = { "svd", "xml" }
})

local signs = { Error = "󰅚 ", Warn = "󰀪 ", Hint = "󰌶 ", Info = "" }
for type, icon in pairs(signs) do
Expand Down

0 comments on commit 538d47f

Please sign in to comment.