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

fix definition jump error #296

Closed
wants to merge 1 commit into from
Closed

fix definition jump error #296

wants to merge 1 commit into from

Conversation

CnsMaple
Copy link

@CnsMaple CnsMaple commented Dec 6, 2023

When I jump to the first letter of a word, it goes to the type definition. I think this is incorrect and should be left in place.

@ray-x
Copy link
Owner

ray-x commented Dec 6, 2023

Would you share the error you saw? And may be also the code and LSP server that reproduce this error.
The code you removed is a feature that allows you to further jump into type-definition. Here is an example

type MyType struct {
   DateField Date
}

If your cursor on DateField Jump to definition will lead you to the definition of Date instead of staying there and doing nothing.

@CnsMaple
Copy link
Author

CnsMaple commented Dec 6, 2023

before:

2023-12-06.17-02-40.mp4

after:

2023-12-06.17-04-24.mp4

@ray-x
Copy link
Owner

ray-x commented Dec 6, 2023

Yes. I think the behavior is as expected. If the cursor is parked at the definition, and you want to go-definition instead of doing nothing, it will go to type-definition
If you think this is confusing, maybe it would be better to add an option to disable it instead. e.g. lsp.definition_type_definition_fallback and default to true.

@CnsMaple
Copy link
Author

CnsMaple commented Dec 9, 2023

thanks

@CnsMaple CnsMaple closed this Dec 9, 2023
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

Successfully merging this pull request may close these issues.

2 participants