mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-04 17:57:15 +00:00
ts_ls: add comments for vue integration and adhere to code style
This commit is contained in:
parent
52d9434377
commit
a792378b46
1 changed files with 53 additions and 57 deletions
|
|
@ -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' })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue