refactor: move vim.filetype.add to lsp.lua

This commit is contained in:
Seymur Bagirov 2024-09-26 17:52:51 +04:00
parent 3c718631f0
commit 09f83ea29d
2 changed files with 15 additions and 6 deletions

View File

@ -43,8 +43,22 @@ return {
'ray-x/go.nvim',
},
config = function()
-- unknown filetypes(needed for some lsp servers)
vim.filetype.add {
pattern = {
['.*/hypr/.*%.conf'] = 'hyprlang',
['openapi.*%.ya?ml'] = 'yaml.openapi',
['openapi.*%.json'] = 'json.openapi',
}
}
local lsp = require("lsp-zero")
lsp.configure('yamlls', {
filetypes = { 'yaml', 'yaml.openapi' }
})
lsp.configure('csharp_ls', {
handlers = {
["textDocument/definition"] = require("csharpls_extended").handler,
@ -207,7 +221,7 @@ return {
local gopls_opts = require("go.lsp").config()
require("mason-lspconfig").setup({
ensure_installed = { 'tsserver', 'svelte', 'lua_ls', 'csharp_ls', 'rust_analyzer', 'gopls' },
ensure_installed = { 'ts_ls', 'svelte', 'lua_ls', 'csharp_ls', 'rust_analyzer', 'gopls' },
handlers = {
lsp.default_setup,
lua_ls = function()

View File

@ -30,11 +30,6 @@ return {
}
}
require('rainbow-delimiters.setup').setup()
vim.filetype.add {
pattern = {
['.*/hypr/.*%.conf'] = 'hyprlang'
}
}
end
},
-- "nvim-treesitter/nvim-treesitter-context"