Search less files when searching in global suppressions.#57890
Merged
CyrusNajmabadi merged 1 commit intodotnet:mainfrom Nov 20, 2021
Merged
Search less files when searching in global suppressions.#57890CyrusNajmabadi merged 1 commit intodotnet:mainfrom
CyrusNajmabadi merged 1 commit intodotnet:mainfrom
Conversation
CyrusNajmabadi
commented
Nov 19, 2021
| { | ||
| private const string PersistenceName = "<SyntaxTreeIndex>"; | ||
| private static readonly Checksum SerializationFormatChecksum = Checksum.Create("25"); | ||
| private static readonly Checksum SerializationFormatChecksum = Checksum.Create("26"); |
Contributor
Author
There was a problem hiding this comment.
our binary format is the same, but we cannot use any existing caches as the new and old data are not compatible with each other.
ryzngard
reviewed
Nov 19, 2021
| name = right; | ||
| } | ||
|
|
||
| if (!syntaxFacts.IsIdentifierName(name)) |
Contributor
There was a problem hiding this comment.
is this even possible with GetNameOfAttribute?
Contributor
Author
There was a problem hiding this comment.
yes. [A.B<int>()]
ryzngard
reviewed
Nov 19, 2021
src/EditorFeatures/Test2/FindReferences/FindReferencesTests.AliasSymbols.vb
Show resolved
Hide resolved
ryzngard
approved these changes
Nov 19, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current approach to finding FAR results in global suppressions is to make all documents with jsut a global attribute in it eligible for searching. This means any doc that has a
[assembly: ...]attribute it in is searched (regardless of what attribute it actually is).This is doubly problematic as to search the doc we need the semantic-model for it, which requires getting the compilation for that project, which requires parsing all the files in the project. In a project like roslyn, we have enough of these attributes scattered everywhere to make it so that we effectively have to create most of the compilations for all our projects just to get no results.
This PR changes our logic to only search docs that actually have a global attribute whose name could match
SuppressMessageAttribute. This means most projects have no hits and we produce no compilations.--
Note: this might mean we might something. For example, if the user has a global alias to SuppressMessageAttribute. But at that point, things are so esoteric i don't think we care at all, and the perf win here is substantive enough to warrant it. If we do want to support such a corner case in the future, we always could, by using a similar mechanism we have in other places where we keep track if alias names and check those. But for this the complexit is likely never going to be worth it given how this should not arise in practice.