-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add "Active file" analysis scope for background analysis in the IDE #39699
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e62aba5
Add "Active file" analysis scope for background analysis in the IDE
mavasani edb2504
Fix build for unit tests
mavasani 4c66dd8
Couple more test fixes
mavasani 3f20333
Fix integration tests
mavasani 70e280d
Revert the change to DesignerAttributeIncrementalAnalyzer to bail out…
mavasani 98b46aa
Improve comment for TODO incremental analyzer
mavasani 3a6892d
Use lock for _lazyAnalyzers field
mavasani 5de0b84
Address some more feedback
mavasani 3cb849e
Tweak ReanalyzeOnOptionChange
mavasani 014ac5c
Use lock for _lasActiveDocument field.
mavasani 14606d7
Use current solution for options.
mavasani 347f8e6
Add comment
mavasani 262abdd
Revert an unnecessary change - we already handle the bail out for non…
mavasani 2c07649
Update documentation and implementation for changes to BackgroundParser
mavasani 382df2e
Update Obsolete attribute strings
mavasani cc090d1
Add comment
mavasani e5b8a1b
Add work coordinator unit tests for different background analysis scopes
mavasani 111ec04
Address PM feedback and change the user facing resource strings to ma…
mavasani be5bd27
Switch the error list scope combo box to match the newly selected bac…
mavasani 1c43467
Revert "Switch the error list scope combo box to match the newly sele…
mavasani c935dba
Revert the hard coded name check for SBD incremental analyzer as unit…
mavasani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
63 changes: 63 additions & 0 deletions
63
src/EditorFeatures/Test/SolutionCrawler/TestDocumentTrackingService.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Collections.Immutable; | ||
using System.Composition; | ||
using Microsoft.CodeAnalysis.Host.Mef; | ||
|
||
namespace Microsoft.CodeAnalysis.Editor.Test | ||
{ | ||
[ExportWorkspaceService(typeof(IDocumentTrackingService)), Shared] | ||
internal sealed class TestDocumentTrackingService : IDocumentTrackingService | ||
{ | ||
private readonly object _gate = new object(); | ||
private event EventHandler<DocumentId> _activeDocumentChangedEventHandler; | ||
private DocumentId _activeDocumentId; | ||
|
||
[ImportingConstructor] | ||
public TestDocumentTrackingService() | ||
{ | ||
} | ||
|
||
public event EventHandler<DocumentId> ActiveDocumentChanged | ||
{ | ||
add | ||
{ | ||
lock (_gate) | ||
{ | ||
_activeDocumentChangedEventHandler += value; | ||
} | ||
} | ||
|
||
remove | ||
{ | ||
lock (_gate) | ||
{ | ||
_activeDocumentChangedEventHandler -= value; | ||
} | ||
} | ||
} | ||
|
||
public event EventHandler<EventArgs> NonRoslynBufferTextChanged | ||
{ | ||
add { } | ||
remove { } | ||
} | ||
|
||
public void SetActiveDocument(DocumentId newActiveDocumentId) | ||
{ | ||
_activeDocumentId = newActiveDocumentId; | ||
_activeDocumentChangedEventHandler?.Invoke(this, newActiveDocumentId); | ||
} | ||
|
||
public DocumentId TryGetActiveDocument() | ||
{ | ||
return _activeDocumentId; | ||
} | ||
|
||
public ImmutableArray<DocumentId> GetVisibleDocuments() | ||
{ | ||
return _activeDocumentId != null ? ImmutableArray.Create(_activeDocumentId) : ImmutableArray<DocumentId>.Empty; | ||
} | ||
} | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can existingData and newData has different items but same length?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. However, this hasn't change as part of this PR, I am just refactoring the code in this PR. I will play around a bit with this and see if I can get a repro to drive this change.