Closed laoshaw closed 2 months ago
I use 'gd' to jump to definition which worked fine initially, then I ctrl-o jump back and try gd on a different function then it reports "buffer 1 not create" and refuse to jump
Tested with vim 9.1 and latest coc.nvim with clangd, can't reproduce.
it works well but jump to declaration instead of definition, is the default gd jump to declarations?
How do you set your gd
mapping? coc.nvim didn't set default gd
.
coc.nvim requests to language server, handle the jumping with locations, before jumping to the document buffer that created and attached. The buffer 1 not created
means the buffer is not created.
[attach] - receive notification: detach
It's strange that coc.nvim received detach
event to detach the buffer.
I used the default suggestion in coc.nvim github:
nmap
it's very odd, I just tried to change .vimrc, it works without issues, I can recover the original .vimrc, it still works, now not sure what is going on, but it works for the moment.
occurs to me on various languages
What's the language server?
when it happens it seems to be LSP irrelevant, I tested clangd and tsserver
Needs a way to reproduce to debug the issue.
will try to find it out, it just came back, not sure if .vimrc caused it since changing .vimrc does make some difference, need check more closely, thanks.
Try to bisect your vimrc
did that before, so far the pattern is: while in the bisect, when my vimrc halves to a certain size(this varies, today's it's the first 700 line), 'gd' starts to fully work, now if I copy the original failed .vimrc, it still works, in short, when it starts to work, there is no more issues for the day. I'm going to try logout/reboot and see if that changes anything.
bisected to certain lines it starts to work, then it keeps working, even after I copy the original .vimrc back, or after a logout/login, or after a reboot, it keeps working and never dies, this is truly odd.
might be my own problem as I could not reproduce it on another ubuntu 22.04 laptop, but it occurs on my ubuntu 22.04 desktop
## versions
vim version: VIM - Vi IMproved 9.0 9000749
node version: v20.12.2
coc.nvim version: 0.0.82-d1568d56 2023-09-29 19:43:34 +0800
coc.nvim directory: /home/userx/.vim/plugged/coc.nvim
term: dumb
platform: linux
## Log of coc.nvim
2024-04-24T22:13:27.606 WARN (pid:6859) [commands] - Command prettier.createConfigFile already registered
2024-04-24T22:13:27.606 WARN (pid:6859) [commands] - Command prettier.openOutput already registered
2024-04-24T22:13:27.606 WARN (pid:6859) [commands] - Command prettier.forceFormatDocument already registered
2024-04-24T22:13:27.606 WARN (pid:6859) [commands] - Command prettier.formatFile already registered
2024-04-24T22:13:27.650 INFO (pid:6859) [plugin] - coc.nvim initialized with node: v20.12.2 after 411
2024-04-24T22:13:27.658 INFO (pid:6859) [services] - LanguageClient clangd state change: stopped => starting
2024-04-24T22:13:27.663 INFO (pid:6859) [language-client-index] - Language server "clangd" started with 6920
2024-04-24T22:13:27.671 INFO (pid:6859) [services] - LanguageClient clangd state change: starting => running
2024-04-24T22:13:27.675 INFO (pid:6859) [services] - service clangd started
2024-04-24T22:13:27.909 INFO (pid:6859) [core-watchman] - watchman watching project: /home/userx/devel/notes
2024-04-24T22:13:29.407 INFO (pid:6859) [attach] - receive notification: jumpDefinition []
2024-04-24T22:13:31.050 INFO (pid:6859) [attach] - receive notification: detach []
2024-04-24T22:13:32.447 INFO (pid:6859) [attach] - receive notification: jumpDefinition []
2024-04-24T22:13:32.451 ERROR (pid:6859) [attach] - Error on notification jumpDefinition Error: Buffer 1 not created.
at FE.getAttachedDocument (/home/userx/.vim/plugged/coc.nvim/build/index.js:194:3344)
at $y.getCurrentState (/home/userx/.vim/plugged/coc.nvim/build/index.js:277:34038)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Iy.request (/home/userx/.vim/plugged/coc.nvim/build/index.js:265:5418)
at async Iy.gotoDefinition (/home/userx/.vim/plugged/coc.nvim/build/index.js:265:6886)
at async Gy.cocAction (/home/userx/.vim/plugged/coc.nvim/build/index.js:277:46159)
at async EventEmitter.<anonymous> (/home/userx/.vim/plugged/coc.nvim/build/index.js:277:47778)
2024-04-24T22:13:39.508 INFO (pid:6859) [attach] - receive notification: showInfo []
now this shows up on both of my ubuntu 22.04, it comes and goes, most of the time it's there. so far I could not track down its root cause, it occurs randomly.
I removed most of my plugins and configuration tweaks, with only coc.nvim and a few must-have plugs, so far there is no issue
Result from CocInfo
Describe the bug
A clear and concise description of what the bug is.
using with c file and a working compile_commands.json with clangd for coc.nvim.
I use 'gd' to jump to definition which worked fine initially, then I ctrl-o jump back and try gd on a different function then it reports "buffer 1 not create" and refuse to jump
Reproduce the bug
We will close your issue when you don't provide minimal vimrc and we can't reproduce it
Create file
mini.vim
with:Start (neo)vim with command:
vim -u mini.vim
Operate vim.
it works well but jump to declaration instead of definition, is the default gd jump to declarations?
Screenshots (optional)
If applicable, add screenshots to help explain your problem.