-
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
Show static members of matching types in completion #52163
Conversation
...CSharp/Portable/Completion/CompletionProviders/EnumAndCompletionListTagCompletionProvider.cs
Outdated
Show resolved
Hide resolved
...CSharp/Portable/Completion/CompletionProviders/EnumAndCompletionListTagCompletionProvider.cs
Outdated
Show resolved
Hide resolved
...CSharp/Portable/Completion/CompletionProviders/EnumAndCompletionListTagCompletionProvider.cs
Outdated
Show resolved
Hide resolved
...CSharp/Portable/Completion/CompletionProviders/EnumAndCompletionListTagCompletionProvider.cs
Show resolved
Hide resolved
...CSharp/Portable/Completion/CompletionProviders/EnumAndCompletionListTagCompletionProvider.cs
Show resolved
Hide resolved
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.
Auto-approval
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.
Thank you! This will be great for the many "extensible enums" we have in the Azure SDKs!
...CSharpTest/Completion/CompletionProviders/EnumAndCompletionListTagCompletionProviderTests.cs
Show resolved
Hide resolved
...CSharp/Portable/Completion/CompletionProviders/EnumAndCompletionListTagCompletionProvider.cs
Show resolved
Hide resolved
src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb
Outdated
Show resolved
Hide resolved
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.
need clarification on potential behavioral change and if the new behavior is desirable.
ad1525d
to
bf59b6c
Compare
@@ -174,6 +193,47 @@ private static async Task HandleSingleTypeAsync(CompletionContext context, Seman | |||
filterText: memberDisplayName)); | |||
} | |||
} | |||
else if (enclosingNamedType is not null) |
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.
Does it work with top level statement?
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.
➡️ Yes, at least for the case of typing this:
int.Parse(empty)
Experimentation revealed a whole bunch of cases where it's a problem to automatically show the completion list. For the new cases, will modify this to only show the completion list after a character is typed. |
bf59b6c
to
0d2372a
Compare
35346b2
to
f604235
Compare
f604235
to
b252b30
Compare
Would this work as designed if someone were to force the completion list using, for example (bindings vary), Ctrl+Space? I.e. the completion list would show, but would it initially show/have selected one of these well-known possible values? |
@heaths Yes, explicit Ctrl+Space will bring up completion with these items included. |
Included, or selected by default. E.g. in the case of enums, the enum is selected automatically after the completion list is filled (seems to be a very short delay): Just trying to understand the expectation here. The hope was that these work like enums, though I can imagine some of the issues you might've hit above, and appreciate having to workaround that to maintain development productivity and consistency. |
@heaths They will be included, but do not influence the selection algorithm. Depending on other factors, an element from this collection may or may not be selected by default. |
Closes #28603