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
If the cursor is on [Note 1](note1.md), it will open note2.md.
If it is anywhere else (even when not on a link), it will open note1.md.
When checking the links with :CocList links, they seem correct: [j]ump shows the proper range and [o]pen goes to the right document.
Test with documentLink/resolve
In a second attempt, I didn't set the target for the textDocument/documentLink request, to receive the documentLink/resolve and check the requested link. I noticed the same behavior:
If the cursor is on [Note 1](note1.md), the range is the one of the note2.md link.
If it is anywhere else (even when not on a link), the range is the one of the note1.md link.
Result from CocInfo
Describe the bug
I'm currently building a language server for a Markdown flavor and found a weird bug when implementing
documentLink
.Given the following Markdown document containing a few links:
When I try to open one linked document with
CocAction('openLink')
, the LSP communication with my server seems correct:However, coc.nvim opens the wrong document:
[Note 1](note1.md)
, it will opennote2.md
.note1.md
.When checking the links with
:CocList links
, they seem correct:[j]ump
shows the proper range and[o]pen
goes to the right document.Test with
documentLink/resolve
In a second attempt, I didn't set the
target
for thetextDocument/documentLink
request, to receive thedocumentLink/resolve
and check the requested link. I noticed the same behavior:[Note 1](note1.md)
, the range is the one of thenote2.md
link.note1.md
link.Reproduce the bug
I can share the Language Server if needed to reproduce the issue. I could reproduce the problem with the following minimal vimrc:
I use this
coc-settings.json
to start my server:After opening a Markdown, I used my
<CR>
mapping to triggeropenLink
.I could also reproduce the same problem with the official gopls language server, following these instructions, I have:
And with the following Go file:
If I trigger
openLink
onhttp://google.com
, it will open GitHub with my browser. But if I trigger it anywhere else, it opens Google.Screenshots (optional)
I recorded two videos showing the problem:
documentLink/resolve
The text was updated successfully, but these errors were encountered: