Skip to content
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

How to use "findReferences" code lens (arguments seem to be missing) #337

Open
krobelus opened this issue Oct 16, 2024 · 0 comments
Open

Comments

@krobelus
Copy link

Given this markdown file

link 1 [section]
link 2 [section]
link 3 [section]

[section]: asdf

if I open it in Kakoune there'll be a code lens sign in the last line.
If I move to that line and try to run it via :lsp-code-lens that doesn't work.
Perhaps this is because the arguments field is omitted?
Even if I interpret missing arguments as [], performing the code lens gives no results.

I suspect we need to pass the position as arguments

LSP: DEBG To server marksman: {"jsonrpc":"2.0","method":"textDocument/codeLens","params":{"textDocument":{"uri":"file:///home/johannes/git/kakoune-lsp/t/test.md"}},"id":1}
LSP: DEBG From server marksman: {"jsonrpc":"2.0","id":1,"result":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":15}},"command":{"title":"3 references","command":"marksman.findReferences"}}]}

LSP: DEBG To server marksman: {"jsonrpc":"2.0","method":"workspace/executeCommand","params":{"arguments":[],"command":"marksman.findReferences"},"id":10}
LSP: DEBG From server marksman: {"jsonrpc":"2.0","id":10,"result":0}

If I try in Neovim, I don't get a code lens at all, not sure why.

krobelus added a commit to kakoune-lsp/kakoune-lsp that referenced this issue Oct 17, 2024
marksman sends a workspace/executeCommand without arguments,
which seems to be allowed by LSP.
Let's interpret it as empty array.

The code lens still doesn't actually seem to do anything, see
artempyanykh/marksman#337
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant