marksman icon indicating copy to clipboard operation
marksman copied to clipboard

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

Open krobelus opened this issue 4 months ago • 0 comments

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 avatar Oct 16 '24 11:10 krobelus