-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Don't provide CodeActionWithDialog if option service is null #67951
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
Conversation
| GetExistingMemberInfo( | ||
| containingType, out var hasEquals, out var hasGetHashCode); | ||
|
|
||
| var globalOptions = document.Project.Solution.Services.GetService<ILegacyGlobalOptionsWorkspaceService>(); |
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.
The core of the change
| GetExistingMemberInfo( | ||
| containingType, out var hasEquals, out var hasGetHashCode); | ||
|
|
||
| var globalOptions = document.Project.Solution.Services.GetService<ILegacyGlobalOptionsWorkspaceService>(); |
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.
❓ Is it possible to leverage #66798 instead?
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.
Oh I don't know this service exists
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.
I don't see it provides reading these values
| private static readonly PerLanguageOption2<bool> s_generateOperators = new( |
It seems like it has a fall back of CodeCleanUpOptions, but the values used here are not part of it, like
https://sourceroslyn.io/#Microsoft.CodeAnalysis.Workspaces/Options/ILegacyGlobalOptionsWorkspaceService.cs,ebbb686a0c6361c3,references
4d7535c to
74db2aa
Compare
Right now
GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs)is callingGetRequiredService()forILegacyGlobalOptionsWorkspaceServiceThis would fail in the LSP scenario, because
ILegacyGlobalOptionsWorkspaceServiceis not guaranteed to be there.Updates:
I also modify theIPickMemberServiceusage here. It is also needed to be non-null.This turn outs to be a bigger work, need to modify a lot of tests. Will do later