mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-16 07:27:47 +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
|
end
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
on_attach =
|
on_attach = mkLuaInline ''
|
||||||
mkLuaInline
|
|
||||||
# lua
|
|
||||||
''
|
|
||||||
function(client, bufnr)
|
function(client, bufnr)
|
||||||
-- ts_ls provides `source.*` code actions that apply to the whole file. These only appear in
|
-- 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`.
|
-- `vim.lsp.buf.code_action()` if specified in `context.only`.
|
||||||
|
|
@ -84,6 +81,7 @@
|
||||||
})
|
})
|
||||||
end, {})
|
end, {})
|
||||||
|
|
||||||
|
-- make sure that vue-language-server handles semantic tokens when we are in a vue file
|
||||||
if vim.bo.filetype == 'vue' then
|
if vim.bo.filetype == 'vue' then
|
||||||
client.server_capabilities.semanticTokensProvider.full = false
|
client.server_capabilities.semanticTokensProvider.full = false
|
||||||
else
|
else
|
||||||
|
|
@ -113,10 +111,8 @@
|
||||||
"package.json"
|
"package.json"
|
||||||
".git"
|
".git"
|
||||||
];
|
];
|
||||||
on_init =
|
on_init = mkLuaInline ''
|
||||||
mkLuaInline
|
-- forward typescript blocks to ts_ls or vtsls depending on which is available first
|
||||||
# lua
|
|
||||||
''
|
|
||||||
function(client)
|
function(client)
|
||||||
client.handlers['tsserver/request'] = function(_, result, context)
|
client.handlers['tsserver/request'] = function(_, result, context)
|
||||||
local ts_clients = vim.lsp.get_clients({ bufnr = context.bufnr, name = 'ts_ls' })
|
local ts_clients = vim.lsp.get_clients({ bufnr = context.bufnr, name = 'ts_ls' })
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue