-
-
Notifications
You must be signed in to change notification settings - Fork 438
When completing HTML tags within a template tag in Neovim, text gets overwritten in unexpected areas. #5331
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
can you share a minimal config to reproduce this issue? I cannot reproduce this on my end. Or try with only blinks and volar to see if this is still reproducible. the debug log i got
btw here's what |
@RayGuo-ergou local root = vim.fn.fnamemodify("./.repro", ":p")
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
local plugins = {
{
"saghen/blink.cmp",
version = "*",
opts = {
keymap = {
preset = "enter",
},
completion = {
documentation = { auto_show = true, window = { border = "rounded" } },
},
},
},
{
"neovim/nvim-lspconfig",
lazy = false,
dependencies = { "saghen/blink.cmp" },
config = function()
local capabilities = {
textDocument = {
foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true,
},
},
}
capabilities = require("blink.cmp").get_lsp_capabilities(capabilities)
local lspconfig = require("lspconfig")
lspconfig.volar.setup({
capabilities = capabilities,
})
end,
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
}) 2025-04-21_22h00_14.mp4However, this configuration depends on nvim-lspconfig, so it's not truly minimal. I'll try to verify the behavior without nvim-lspconfig 👍
Plugin versions:
|
@RayGuo-ergou local root = vim.fn.fnamemodify("./.repro", ":p")
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
local function get_typescript_server_path(root_dir)
local project_root = vim.fs.dirname(vim.fs.find("node_modules", { path = root_dir, upward = true })[1])
return project_root and vim.fs.joinpath(project_root, "node_modules", "typescript", "lib") or ""
end
---@type vim.lsp.Config
vim.lsp.config.volar = {
cmd = { "vue-language-server", "--stdio" },
filetypes = { "vue" },
root_markers = { "package.json" },
init_options = { typescript = { tsdk = "" } },
before_init = function(_, config)
if config.init_options and config.init_options.typescript and config.init_options.typescript.tsdk == "" then
config.init_options.typescript.tsdk = get_typescript_server_path(config.root_dir)
end
end,
}
vim.lsp.enable({ "volar" })
local plugins = {
{
"saghen/blink.cmp",
version = "*",
opts = {},
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
|
Hi @tadashi-aikawa Thanks for providing the reproduction config but unfortunately I still cannot reproduce it.(just figured that just to be clear I was using nvim -v
Found existing alias for "nvim". You should use: "vim"
NVIM v0.12.0-dev-178+gd3cded796c
Build type: RelWithDebInfo
LuaJIT 2.1.1744317938
Run "nvim -V1 -v" for more info This is my neovim version |
Also tried on both |
@RayGuo-ergou
I've also confirmed that my Volar version is indeed 2.2.8. $ vue-language-server --version
2.2.8 Additionally, in my environment, completions don't seem to appear even when I start typing right after I'll keep an eye on it for now. Thank you for your valuable time! 2025-04-21_23h58_28.mp4 |
Hi, @RayGuo-ergou :) I'd like to report that the issue has been resolved. In conclusion, reinstalling Volar fixed the problem. DetailsToday, I checked on my work machine and couldn't reproduce the issue. I verified this with both versions 2.2.8 and 2.2.10. When I returned home and checked with the same versions, the issue still occurred on my home machine. After uninstalling and reinstalling I have no idea why this issue was occurring so specifically on my setup, but thanks to your help, I can now comfortably develop in Vue! Thank you very much for your considerate support! |
@tadashi-aikawa Glad that you have resolved. Happy coding.🎉 |
Vue - Official extension or vue-tsc version
2.2.8
VSCode version
1.99.3
Vue version
3.5.13
TypeScript version
5.8.3
System Info
package.json dependencies
Steps to reproduce
Create a vue project.
Open and edit
src/App.vue
in Neovim.When type
<div
and display suggestions.Then select/confirm one of the suggestions
div
.What is expected?
What is actually happening?
2025-04-20_14h01_21.mp4
Link to minimal reproduction
No response
Any additional comments?
I didn't experience this issue when using the "Vue - Official" extension in VSCode, and the problem doesn't occur in Vue files that don't have a
<script>
tag.While using Neovim with plugins like nvim-lspconfig and blink.cmp for LSP and completion support, I checked the LSP debug logs and found the following output from the Volar LSP:
Looking at this log, I can see that
range.start
andrange.end
are pointing to different lines. Since this issue doesn't occur with other LSPs, I suspect this might be specific to the Volar LSP implementation.The code that generated this log output can be found in the Neovim repository here:
https://github.com/neovim/neovim/blob/4b909528516032b002a4a32f3e06f0eb6185ea6b/runtime/lua/vim/lsp/client.lua?plain=1#L678
This is my first time investigating LSP logs and troubleshooting this kind of issue, so please let me know if I've missed anything or if my comments aren't relevant :)
The text was updated successfully, but these errors were encountered: