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

feat: goto definition #49

Merged
merged 1 commit into from
Dec 22, 2023
Merged

Conversation

WillLillis
Copy link
Collaborator

Adds goto definition capabilities for labels, building off of the work from #36.

Completes one of the requests in #44

@WillLillis WillLillis force-pushed the goto_definition branch 4 times, most recently from a9ee10f to ac523d0 Compare December 21, 2023 17:57
@WillLillis
Copy link
Collaborator Author

WillLillis commented Dec 21, 2023

Not related to this PR but I believe we can replace the call to get_word_from_file_params() on line 203 of src/bin/main.rs with similar logic used in get_goto_def_resp() from this PR to get the word the hover request was issued for. Doing so should speed things up a bit since we're grabbing a slice of an in-memory string rather than a file.

For example, something like https://github.com/WillLillis/asm-lsp/blob/3e948be81f0b751079b5330c5f6a2c101387315e/src/bin/main.rs#L203

Copy link
Owner

@bergercookie bergercookie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great!

src/lsp.rs Show resolved Hide resolved
Clean up comments

Replace use of get_word_from_file_params() in get_goto_def_resp()

Use lsp_pos_of_point()

Refactor get word logic into function
@WillLillis WillLillis merged commit 77503f5 into bergercookie:master Dec 22, 2023
14 checks passed
@WillLillis WillLillis deleted the goto_definition branch December 22, 2023 17:20
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