-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Extract async navigation portions of https://github.com/dotnet/roslyn/pull/55635 #55891
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
4904378
In progress
CyrusNajmabadi 42dceae
Don't hold onto documents in 'Find' features
CyrusNajmabadi 3cd3247
Move to rehydrate
CyrusNajmabadi f65655f
Move to rehydrate
CyrusNajmabadi b42ba1b
Sigh...
CyrusNajmabadi 50dca19
Almost done with goto def
CyrusNajmabadi a27dced
More async work
CyrusNajmabadi 67a04c5
Add a TWD for find usages navigation
CyrusNajmabadi 7ee157d
Move threading switches
CyrusNajmabadi 0e3d768
Use conditional
CyrusNajmabadi 6295006
can do CA9false)
CyrusNajmabadi b14d9d3
Fix tests
CyrusNajmabadi 0eb6533
Properly switch
CyrusNajmabadi 5d57c37
Properly switch
CyrusNajmabadi b6ae453
Handle null value
CyrusNajmabadi e7148a0
Async nav
CyrusNajmabadi cf021e0
Use original workspace.
CyrusNajmabadi 312eff6
Add docs
CyrusNajmabadi 730289d
Move all to ConfigurAwait(false)
CyrusNajmabadi 5b35709
Switch to ConfigureAwait(true)
CyrusNajmabadi bc8632a
Make members obsolete
CyrusNajmabadi f2f34f7
Add comment
CyrusNajmabadi 69157f9
Add comment
CyrusNajmabadi a7f8ce9
Keep the workspace in the span we pass around
CyrusNajmabadi 023a89a
revert
CyrusNajmabadi 8d6bf9e
Add comment
CyrusNajmabadi d3704ae
remove method
CyrusNajmabadi 3c6f68a
Make static local
CyrusNajmabadi 7517e32
Switch to UIthread
CyrusNajmabadi be47bf0
Revert
CyrusNajmabadi 99e8ce1
Fix
CyrusNajmabadi b0173a7
Merge remote-tracking branch 'upstream/main' into holdDocs
CyrusNajmabadi b60a74e
Pass solutions along
CyrusNajmabadi 4225f07
Map goto impl calls
CyrusNajmabadi 78fc808
Add comment
CyrusNajmabadi a716914
Merge remote-tracking branch 'upstream/main' into holdDocs
CyrusNajmabadi ab9432f
Merge remote-tracking branch 'upstream/main' into holdDocs
CyrusNajmabadi 9ee36e0
Merge remote-tracking branch 'upstream/main' into holdDocs
CyrusNajmabadi 2ab6496
Revert
CyrusNajmabadi 4db39fa
Remove unneeded code
CyrusNajmabadi 7f026a4
Revert
CyrusNajmabadi 1c79f1a
REvert
CyrusNajmabadi 9f41c2a
Simplify
CyrusNajmabadi c1c20dd
Revert
CyrusNajmabadi 2992f03
revert
CyrusNajmabadi fcd5b7f
Ververt
CyrusNajmabadi 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,11 @@ | |
using Microsoft.CodeAnalysis.Editor.FindUsages; | ||
using Microsoft.CodeAnalysis.Editor.Host; | ||
using Microsoft.CodeAnalysis.Editor.Shared.Utilities; | ||
using Microsoft.CodeAnalysis.FindUsages; | ||
using Microsoft.CodeAnalysis.GoToDefinition; | ||
using Microsoft.CodeAnalysis.LanguageServices; | ||
using Microsoft.CodeAnalysis.Navigation; | ||
using Microsoft.CodeAnalysis.PooledObjects; | ||
using Microsoft.CodeAnalysis.Shared.Extensions; | ||
using Roslyn.Utilities; | ||
|
||
|
@@ -112,16 +114,25 @@ private bool TryGoToAlternativeLocationIfAlreadyOnDefinition( | |
if (interfaceImpls.Length == 0) | ||
return false; | ||
|
||
var definitions = interfaceImpls.SelectMany( | ||
i => GoToDefinitionHelpers.GetDefinitions( | ||
i, solution, thirdPartyNavigationAllowed: false, cancellationToken)).ToImmutableArray(); | ||
|
||
var title = string.Format(EditorFeaturesResources._0_implemented_members, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this entire synchronous codepath will hopefully go away in a future PR. |
||
FindUsagesHelpers.GetDisplayName(symbol)); | ||
|
||
return _threadingContext.JoinableTaskFactory.Run(() => | ||
_streamingPresenter.TryNavigateToOrPresentItemsAsync( | ||
_threadingContext, solution.Workspace, title, definitions, cancellationToken)); | ||
return _threadingContext.JoinableTaskFactory.Run(async () => | ||
{ | ||
using var _ = ArrayBuilder<DefinitionItem>.GetInstance(out var definitions); | ||
foreach (var impl in interfaceImpls) | ||
{ | ||
// Use ConfigureAwait(true) here. Not for a correctness requirements, but because we're | ||
// already blocking the UI thread by being in a JTF.Run call. So we might as well try to | ||
// continue to use the blocking UI thread to do as much work as possible instead of making | ||
// it wait for threadpool threads to be available to process the work. | ||
definitions.AddRange(await GoToDefinitionHelpers.GetDefinitionsAsync( | ||
impl, solution, thirdPartyNavigationAllowed: false, cancellationToken).ConfigureAwait(true)); | ||
} | ||
|
||
return await _streamingPresenter.TryNavigateToOrPresentItemsAsync( | ||
_threadingContext, solution.Workspace, title, definitions.ToImmutable(), cancellationToken).ConfigureAwait(true); | ||
}); | ||
} | ||
|
||
private static bool IsThirdPartyNavigationAllowed(ISymbol symbolToNavigateTo, int caretPosition, Document document, CancellationToken cancellationToken) | ||
|
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.
this is jus tmoving to a try/finally so all return paths call ONCompletedAsync.
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.
viewing this PR with whitespace off will help.