-
-
Notifications
You must be signed in to change notification settings - Fork 437
Duplicate code suggestions on some items #5002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Make sure that you has enabled the hybrid mode. The following is my configuration, it has no problem. (same version v2.1.10) local ts_config = {
name = 'lsp-ts',
cmd = { 'typescript-language-server.cmd', '--stdio' },
root_dir = vim.fs.root(0, { 'package.json' }),
init_options = {
plugins = {
{
name = '@vue/typescript-plugin',
location = 'path/to/vue-language-server',
languages = { 'vue' },
}
}
}
}
local vue_config = {
name = 'lsp-vue',
cmd = { 'vue-language-server.cmd', '--stdio' },
root_dir = vim.fs.root(0, { 'package.json' }),
init_options = {
vue = {
hybridMode = true, -- Note
},
typescript = {
tsdk = 'path/to/tsdk'
}
}
}
vim.api.nvim_create_autocmd('FileType', {
pattern = {
'javascript', 'vue',
},
callback = function()
vim.lsp.start(ts_config)
vim.lsp.start(vue_config)
end,
}) |
I have pretty much the same config |
@Tobls I have tested all the config methods which listed on readme, the duplicate result only appear on Non-Hybrid mode 2th. I assume you are using nvim-lspconfig and had installed ts, vue server. Following below steps:
./test.lua: vim.cmd('packadd nvim-lspconfig')
require('lspconfig').ts_ls.setup({
init_options = {
plugins = {
{
name = '@vue/typescript-plugin',
location = '/path/to/vue-language-server',
languages = {'vue'},
},
},
},
filetypes = { "javascript", "vue", },
})
require('lspconfig').volar.setup({
init_options = {
typescript = {
tsdk = '/path/to/tsdk'
}
}
}) |
i had same issue in vscode. i noticed that the issue only occurs when Hybrid is turned off. |
I have exactly this configuration, but still get duplicate suggestions. |
Since one |
Sure, these are the relevant nvim plugins in the configurations I use (With lazy as a plugin manager):
Mason:
CMP:
|
I mean a typescript project reproduction, and you can also try to create a brand new project with |
Vue - Official extension or vue-tsc version
2.1.10
VSCode version
Vue version
3.4.30
TypeScript version
System Info
package.json dependencies
Steps to reproduce
When trying to auto-import anything from vue, I get two autocompletion items, with only the second one actually importing it if needed.


What is expected?
Only the second completion item, the one that also auto-imports.
What is actually happening?
I get two autocompletion items, and the one without auto-import is the default.
Link to minimal reproduction
No response
Any additional comments?
I am using neovim and the hyprid mode
The text was updated successfully, but these errors were encountered: