-
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
Move to new API for GetSuggestedActions #39914
Conversation
Editor team recently added a new GetSuggestedActions API overload that allows providing a more detailed operation scope message. This PR moves us to that API for Roslyn suggested actions. We now display the name of the executing analyzer/fixer/refactoring when user hits Ctrl + Dot to bring up the light bulb. This should help the users identify the slow extension and help us in improving performance of our analyzers/fixers/refactorings.
...es/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs
Outdated
Show resolved
Hide resolved
This is definitely interesting. But my preference woudl be more than when i'm invoking a code-action i get good feedback about what is going on. We used to support that, but now all i see is something vague like "applying code action to 'project'" which is effectively useless. |
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
Outdated
Show resolved
Hide resolved
...es/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs
Outdated
Show resolved
Hide resolved
done with pass. |
Thanks, that would be a separate feature request. This PR mainly aims at improving the messaging when computing diagnostics + code actions for light bulb, so we can tackle some of the delays we are seeing light bulb showing up after Ctrl + Dot. |
@mavasani Can you submit the NRT changes to master, and then we'll update this to a simpler form? |
Seems like lot of unnecessary duplicate work… the NRT changes are minimal, so is there a big concern in doing it within this PR? I believe it is best to keep enabling nullable as and when we update/fix code. Splitting into separate PR makes sense for large refactoring where nullable is enabled across large number of files/projects... |
Agreed. Though my general feedback is: can we fix our existing bad behavior (and regressions) in this space prior to doing more feature work? |
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
Outdated
Show resolved
Hide resolved
src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs
Outdated
Show resolved
Hide resolved
src/Features/Core/Portable/CodeRefactorings/ICodeRefactoringService.cs
Outdated
Show resolved
Hide resolved
...es/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs
Outdated
Show resolved
Hide resolved
Yes, but that should probably come at some other place. This code path does not guarantee analyzers are executed, their results might be used from the cache on this path. |
src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
Outdated
Show resolved
Hide resolved
I'm on the fence about the nullable changes. I think ther'es enough value here to keep in this PR. but it definitely added noise. However, as the king of making noisy chnages, it would be hypocritical of me to protest when i'm reviewing myself :D |
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.
In terms of using new LightBulb API looks good.
@sharwell @CyrusNajmabadi Any further feedback? thanks! |
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
Outdated
Show resolved
Hide resolved
src/Features/LanguageServer/Protocol/Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj
Show resolved
Hide resolved
@jasonmalinowski Test failures in this PR seem to be coming from the inferred indentation kicking in at Lines 92 to 98 in aeabd60
I can do one of the following to resolve this (in order of my preference):
|
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs
Outdated
Show resolved
Hide resolved
...es/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs
Show resolved
Hide resolved
@dotnet/roslyn-infrastructure What is the version of Visual Studio being used for our integration tests? Have we moved to latest 16.4 public preview or are the integration tests still running on 16.3? |
Editor team recently added a new GetSuggestedActions API overload that allows providing a more detailed operation scope message. This PR moves us to that API for Roslyn suggested actions. We now display the name of the executing analyzer/fixer/refactoring when user hits Ctrl + Dot to bring up the light bulb. This should help the users identify the slow extension and help us in improving performance of our analyzers/fixers/refactorings.