-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Remove suggestion mode for implicit array creation #24495
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
|
the issue here is that the user may type |
I agree we probably don't need suggestion mode. But we do need to ensure that the items is not hard selected. |
|
From my understanding, if the item were soft-selected, then the common scenario would become less convenient (user must use arrow to select). One potential way out would be to keep hard-selection for object creation, but use soft-selection when inferred type is an array. I'll try that. |
Yes. That's intentional though. Otherwise the other normal scenario (implicit arrays) becomes painful. implicit arrays are totally reasonable and normal to type. It was intentional to make it so that we don't aggressively complete arrays and annoy the user when they type this. |
eb1941d to
3dedfc4
Compare
3dedfc4 to
56fe595
Compare
|
Here are a few cases I'll be looking to verify:
|
Interesting! Does ctrl-space change soft-selection to hard selection? Another test case would be:
Should make "new Foo" |
The Edit.CompleteWord command is allowed to always assume that the user is attempting to insert a reference to something that already exists.
This case is covered by my first typing case, assuming that pressing Tab completes a soft-selected item. |
70de229 to
5bddcb8
Compare
|
@sharwell I added some tests cases as you suggested, although I think they relate more to completion on "new" which is a different provider. |
|
I think ctrl-space is "complete word" right? If so, you can use testState.SendCommitUniqueCompletionListItem |
|
Note: i don't see anything in the complete-word codepath that would cause soft-selection to become hard selection. This is functionality i think we'd have to add. |
|
@sharwell ctrl+space sounds like a separate issue. |
|
@jcouv It looks good. Do we have any tests yet for this syntax? I expect they will all pass but it'd still be good to have them. int[] = { 0 }; |
sharwell
left a comment
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.
💡 Consider adding tests for the array initializer syntax if there aren't any already.
|
@Pilchie I'm not sure the current ask-mode process for 15.7. Please approve if ask-mode in effect. Thanks |
|
Checked with Jared. No ask-mode approval required for this branch yet. I'll go ahead and merge. Thanks |
Customer scenario
Type
Class[] x = new Class[]. You expect theClasson the right-hand-side to be completed. But actually, there was a suggestion mode for implicit array creation that prevented such completion.I don't think such a suggestion mode makes sense. Suggestion modes prevent completion when the user might type a never-seen word, but that is not the case here. So I removed it.
Bugs this fixes
Fixes #24432
Workarounds, if any
You can always fight against the completion, but it's annoying.
Risk
Performance impact
Is this a regression from a previous update?
No
Root cause analysis
How was the bug found?
Reported by customer
FYI @CyrusNajmabadi @sharwell