Skip to content

Simplify logic of determining Reference definition #1139

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

Conversation

TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Dec 20, 2019

fixes PowerShell/vscode-powershell#2374

Before, I had the logic backwards and the CodeLens would only show 1 reference (the reference definition!).

After, now we only check file path and line number. Simpler logic.

I added a TODO to think about what would happen if we find two of the same named function definitions:
fileA

function Test-Foo { }

fileB

function Test-Foo { }

The references will probably show up... but I think there's not much we can do since the symbol reference doesn't seem to give us anything on whether it's a definition or not which is really a shame.

Copy link
Contributor

@rjmholt rjmholt left a comment

Choose a reason for hiding this comment

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

LGTM, although would like to discuss more how we can refine/improve our symbol logic

@TylerLeonhardt TylerLeonhardt merged commit f20e5be into PowerShell:master Jan 3, 2020
@TylerLeonhardt TylerLeonhardt deleted the fix-boolean-logic-references branch April 11, 2020 19:40
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.

CodeLens References link only jumps to definition
2 participants