ts_ls: add comments for vue integration and adhere to code style

This commit is contained in:
Mia 2025-12-26 01:19:59 +01:00
commit a792378b46

View file

@ -65,10 +65,7 @@
end
'';
};
on_attach =
mkLuaInline
# lua
''
on_attach = mkLuaInline ''
function(client, bufnr)
-- ts_ls provides `source.*` code actions that apply to the whole file. These only appear in
-- `vim.lsp.buf.code_action()` if specified in `context.only`.
@ -84,6 +81,7 @@
})
end, {})
-- make sure that vue-language-server handles semantic tokens when we are in a vue file
if vim.bo.filetype == 'vue' then
client.server_capabilities.semanticTokensProvider.full = false
else
@ -113,10 +111,8 @@
"package.json"
".git"
];
on_init =
mkLuaInline
# lua
''
on_init = mkLuaInline ''
-- forward typescript blocks to ts_ls or vtsls depending on which is available first
function(client)
client.handlers['tsserver/request'] = function(_, result, context)
local ts_clients = vim.lsp.get_clients({ bufnr = context.bufnr, name = 'ts_ls' })