Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Make 'Find All References' Work with Text Selection - #2226

Merged
Ramya Rao (ramya-rao-a) merged 1 commit into
microsoft:masterfrom
richardatphilo:master
Jan 7, 2019
Merged

Make 'Find All References' Work with Text Selection#2226
Ramya Rao (ramya-rao-a) merged 1 commit into
microsoft:masterfrom
richardatphilo:master

Conversation

@richardatphilo

Copy link
Copy Markdown
Contributor

This fixes a minor annoyance: When you highlight an identifier in the editor using text selection, using 'Find All References' will return 0 results. This is because the position parameter passed to the provideReferences function will refer to the end of the selection, and guru apparently will not consider the token immediately behind the byte offset.

The extension already defines a custom wordPattern for Go syntax, and the provideReferences function uses this via document.getWordRangeAtPosition to do a sanity check on the position. This change just uses the position at the start of the word range instead of the parameter passed to provideReferences. This enables 'Find All References' to work with text selection (or when the cursor is immediately after an identifier).

@ramya-rao-a

Copy link
Copy Markdown
Contributor

richardatphilo, Looks like this is your first PR in this project, Thanks & Welcome!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants