Skip to content

Show static members of matching types in completion#52163

Merged
sharwell merged 6 commits intodotnet:mainfrom
sharwell:static-members
Mar 26, 2021
Merged

Show static members of matching types in completion#52163
sharwell merged 6 commits intodotnet:mainfrom
sharwell:static-members

Conversation

@sharwell
Copy link
Contributor

@sharwell sharwell commented Mar 26, 2021

image

image

image

image

Closes #28603

@sharwell sharwell requested a review from a team as a code owner March 26, 2021 05:05
@ghost ghost added the Area-IDE label Mar 26, 2021
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approval

Copy link

@heaths heaths left a 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!

Copy link
Contributor

@CyrusNajmabadi CyrusNajmabadi left a 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.

Copy link
Member

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?

Copy link
Contributor Author

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)

@sharwell sharwell marked this pull request as draft March 26, 2021 20:08
@sharwell
Copy link
Contributor Author

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.

@sharwell sharwell marked this pull request as ready for review March 26, 2021 20:44
@sharwell sharwell merged commit c7bf6b2 into dotnet:main Mar 26, 2021
@ghost ghost added this to the Next milestone Mar 26, 2021
@sharwell sharwell deleted the static-members branch March 26, 2021 23:30
@heaths
Copy link

heaths commented Mar 29, 2021

For the new cases, will modify this to only show the completion list after a character is typed.

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?

@sharwell
Copy link
Contributor Author

sharwell commented Mar 29, 2021

@heaths Yes, explicit Ctrl+Space will bring up completion with these items included.

@heaths
Copy link

heaths commented Mar 29, 2021

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):

image

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.

@sharwell
Copy link
Contributor Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Intellisense should suggest static members of target type

5 participants