Skip to content

Add assert to make sure getOccurences at position only returns results f... #2379

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

Merged
merged 3 commits into from
Mar 30, 2015

Conversation

paulvanbrenk
Copy link
Contributor

Add assert to make sure getOccurences at position only returns results for the file we request the occurences for.

This should help figure out why #1153 is happening.

…s for the file we request the occurences for.
}

/// References and Occurrences
function getOccurrencesAtPositionCore(fileName: string, position: number): ReferenceEntry[] {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we just filter instead. this is going to fail anyways. just remove the entries.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This won't crash VS, and I rather have this fixed in the script side to prevent we do unnecessary work there.

Copy link
Contributor

Choose a reason for hiding this comment

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

i meant to filter on the script side. you know the caller asked for a specific file, so just filter results that are not there.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the idea is that we shouldn't be finding more results anyways. It represents a bug in our code that we should not be trying to workaround. Instead, we should track down the actual bug and fix it.

paulvanbrenk added a commit that referenced this pull request Mar 30, 2015
Add assert to make sure getOccurences at position only returns results f...
@paulvanbrenk paulvanbrenk merged commit a4b71a1 into master Mar 30, 2015
@paulvanbrenk paulvanbrenk deleted the referencesFileAssert branch March 30, 2015 21:07
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
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.

4 participants