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/definition returns targetSelectionRange with a start and end of (0,0). #735

Closed
seanlynch opened this issue Dec 3, 2021 · 3 comments · Fixed by #759
Closed
Labels
bug Something isn't working textDocument/definition

Comments

@seanlynch
Copy link

seanlynch commented Dec 3, 2021

Apologies for the lack of detail; I encountered this on a machine I cannot log into my personal Github account from.

Server Version

0.25.0

Terraform Version

1.0.3

Client Version

emacs-lsp

Terraform Configuration Files

Shouldn't be relevant

Log Output

Hopefully not needed

Expected Behavior

According to the spec, targetSelectionRange must contain targetRange. So I expect that to be the case.

Actual Behavior

targetSelectionRange has a start and end at line 0 column 0, which does not contain targetRange.

Steps to Reproduce

Set up terraform-ls with emacs-lsp and try to go to a definition with lsp-find-definition.

@seanlynch
Copy link
Author

seanlynch commented Dec 3, 2021

The relevant section of the LSP spec:

/**
 * The range that should be selected and revealed when this link is being
 * followed, e.g the name of a function. Must be contained by the the
 * `targetRange`. See also `DocumentSymbol#range`
 */
targetSelectionRange: Range;

@radeksimko radeksimko added bug Something isn't working textDocument/definition labels Dec 6, 2021
@radeksimko
Copy link
Member

Good catch, thank you for the report.

It looks like this was just missed in the recent refactoring in 0.24.0+

6fb9f47#diff-b369d9fbb9324988bd48fac32b664e430f1d06101dd0307d7574e47b69d790ddL25

I will raise a PR with patch.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working textDocument/definition
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants