Skip to content

Commit 29aa5bf

Browse files
committed
setup more language servers i use + allow customizing filetypes
1 parent 7da1058 commit 29aa5bf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

init.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,12 +424,16 @@ end
424424
--
425425
-- Add any additional override configuration in the following tables. They will be passed to
426426
-- the `settings` field of the server config. You must look up that documentation yourself.
427+
--
428+
-- If you want to override the default filetypes that your language server will attach to you can
429+
-- define the property 'filetypes' to the map in question.
427430
local servers = {
428431
-- clangd = {},
429432
-- gopls = {},
430433
-- pyright = {},
431434
-- rust_analyzer = {},
432435
-- tsserver = {},
436+
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
433437

434438
lua_ls = {
435439
Lua = {
@@ -459,8 +463,9 @@ mason_lspconfig.setup_handlers {
459463
capabilities = capabilities,
460464
on_attach = on_attach,
461465
settings = servers[server_name],
466+
filetypes = servers[server_name].filetypes,
462467
}
463-
end,
468+
end
464469
}
465470

466471
-- [[ Configure nvim-cmp ]]

0 commit comments

Comments
 (0)