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

textDocument/references on any occurrence of a variable doesn't currently provide a list of references #86

Closed
leungbk opened this issue May 31, 2023 · 0 comments
Labels
A-lsp Area: LSP conformance issues and missing features C-feature Catagory: feature

Comments

@leungbk
Copy link

leungbk commented May 31, 2023

If I have

let x = 1;
    y = x + 1;
    z = x + 42;
in z

then if I have my cursor at the assignment of x, then textDocument/references works as expected. However, if the cursor is at either of the two uses of x, textDocument/references does not work at all.

I think it makes sense to also have textDocument/references work when using it with the cursor on either use of x---this is the behavior I see from some other language servers.

However, I cannot find anything in the protocol about what exactly it ought to return. I have seen at least one server return references while excluding the initial assignment, while others do not exclude the initial assignment. I'm also unsure whether to include the reference at the cursor in the list of returned references, though I would personally prefer to include it.

@oxalica oxalica added C-feature Catagory: feature A-lsp Area: LSP conformance issues and missing features labels May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lsp Area: LSP conformance issues and missing features C-feature Catagory: feature
Projects
None yet
Development

No branches or pull requests

2 participants