You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For those using nvim_cmp and cmp-nvim-lsp, it is common to notify the language server (LS) about additional client capabilities added by cmp-nvim-lsp (on top of what Neovim has built-in), so the LS sends all its completion options etc. to the client (I think that is the purpose, though I am not 100% certain).
How can such capabilities be added to typescript-tools?
Here is how it is normally done with other LSPs, inside the config function of nvim-lspconfig, if using lazy.nvim and cmp-nvim-lsp is included as a dependency.
The parameters passed into the setup function are also passed to the standard nvim-lspconfig server setup, allowing you to use the same settings here. But you can pass plugin-specific options through the settings parameter, which defaults to:
As such I was thinking to do something like this (and making sure cmp_nvim_lsp is installed beforehand):
-- These two lines are added somewhere we have access to 'cmp_nvim_lsp'.localcapabilities=vim.lsp.protocol.make_client_capabilities()
capabilities=vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
require("typescript-tools").setup {
server= {
capabilities=capabilities
},
-- ....settings= {
-- ....
}
}
What is the right way to do this? Perhaps I should not nest capabilities inside a server table.
Thank you.
The text was updated successfully, but these errors were encountered:
For those using
nvim_cmp
andcmp-nvim-lsp
, it is common to notify the language server (LS) about additional client capabilities added bycmp-nvim-lsp
(on top of what Neovim has built-in), so the LS sends all its completion options etc. to the client (I think that is the purpose, though I am not 100% certain).How can such capabilities be added to
typescript-tools
?Here is how it is normally done with other LSPs, inside the
config
function ofnvim-lspconfig
, if usinglazy.nvim
andcmp-nvim-lsp
is included as a dependency.The
typescript-tools
README says:The parameters passed into the setup function are also passed to the standard nvim-lspconfig server setup, allowing you to use the same settings here. But you can pass plugin-specific options through the settings parameter, which defaults to:
As such I was thinking to do something like this (and making sure
cmp_nvim_lsp
is installed beforehand):What is the right way to do this? Perhaps I should not nest
capabilities
inside aserver
table.Thank you.
The text was updated successfully, but these errors were encountered: