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

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

Merged
merged 1 commit into from
Jan 7, 2019

Conversation

richardatphilo
Copy link
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
Contributor

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

@ramya-rao-a ramya-rao-a merged commit 9943ca1 into microsoft:master Jan 7, 2019
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