Skip to content
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

Have to press enter twice after typing out full completion #11944

Closed
roblourens opened this issue Sep 13, 2016 · 12 comments
Closed

Have to press enter twice after typing out full completion #11944

roblourens opened this issue Sep 13, 2016 · 12 comments
Assignees
Labels
feature-request Request for new features or functionality suggest IntelliSense, Auto Complete verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@roblourens
Copy link
Member

If I have a variable, say set, and type set in the debug console, then the completions popup is visible with set and any other completions. Then the user has to press enter twice - once to close the completions popup, and again to eval set.

image

I think that if the user has typed the full name of the completion, then pressing enter once should close the popup and eval that value. But if the user only types part of the completion like se, it should work as it does now.

@roblourens roblourens added debug-console feature-request Request for new features or functionality labels Sep 13, 2016
@isidorn
Copy link
Contributor

isidorn commented Sep 19, 2016

This is how the suggest widget accept on enter behaves also in the editor.
We should be consistent. Thus assigning this to @jrieken to consider if it should be changed everywhere.

@isidorn isidorn assigned jrieken and unassigned isidorn Sep 19, 2016
@jrieken jrieken assigned isidorn and unassigned jrieken Sep 19, 2016
@jrieken
Copy link
Member

jrieken commented Sep 19, 2016

Disagree - the editor and the repl are different beasts and accepting inserting a new line whenever you auto complete doesn't make sense in the editor. I am pretty sure @isidorn is aligned on that. Either change the default for the repl or tell users to do so - the change should be trivial, just preprint ^ to key. That tells the service to trigger listeners but still handle the events as if it would do without keybindings

@isidorn isidorn added this to the September 2016 milestone Sep 19, 2016
@isidorn
Copy link
Contributor

isidorn commented Sep 20, 2016

preprint ^ to key

@jrieken Thanks for the tip, but what exact key do you mean? I tried preprinting it to the currentWord but that did not work.

@jrieken
Copy link
Member

jrieken commented Sep 20, 2016

Sorry, prepend to the command id, like we do it here in TypeScript which means. Bind . to run the command and insert dot-character.

@isidorn
Copy link
Contributor

isidorn commented Sep 20, 2016

Thanks @jrieken this works however as you said this makes the suggestion be accepted and the listeners triggered - which in my world means a new line is added on enter(editor reacted on the listener). I would need two of my actions to be exectued, suggestion accepted and repl input accepted and only in the special case that the input matches the whole selection. Not sure if this is possible.

For comparison chrome dev tools always evalutes on enter and never acceppts the suggestion - I am also against that since it is much different behavior than our editor. Also the user can configure this via "editor.acceptSuggestionOnEnter": false

@jrieken
Copy link
Member

jrieken commented Sep 20, 2016

I wasn't trying to say what the repl should do. Surely this isn't a default for the normal text editor, for the repl maybe and iff not it the configuration users have to do

@isidorn
Copy link
Contributor

isidorn commented Feb 23, 2017

Decided that this is less frustrating than #18751
So reopening and will have to do a proper solution for this one in the future - something similar to what chrome dev tools are doing

@isidorn isidorn reopened this Feb 23, 2017
@isidorn isidorn removed verification-needed Verification of issue is requested verified Verification succeeded labels Feb 23, 2017
@isidorn
Copy link
Contributor

isidorn commented Mar 15, 2017

fyi @jrieken this is the issue I was mentioning in the standup
I was searching through suggest widget feature requests but could not find the one you mentioned that people already want this.

@jrieken jrieken added the suggest IntelliSense, Auto Complete label Mar 15, 2017
@isidorn
Copy link
Contributor

isidorn commented Mar 23, 2017

Assigning also to @jrieken and moving to the next milestone to potentially look into it then

@jrieken
Copy link
Member

jrieken commented Apr 3, 2017

related to #15702. There is two options: Hide items that will result in a no-op or make Enter insert a newline for those items

@jrieken
Copy link
Member

jrieken commented Apr 3, 2017

I have now implemented this, which is keeping perfect matches but not binding Enter for those.

apr-03-2017 14-59-15

@isidorn
Copy link
Contributor

isidorn commented Apr 3, 2017

@jrieken OMG awesome. I owe you at least one beer for this!
Tried it out in the debug console and it works like a charm -> thus closing this.

@isidorn isidorn closed this as completed Apr 3, 2017
@jrieken jrieken added the verification-needed Verification of issue is requested label Apr 25, 2017
@bpasero bpasero added the verified Verification succeeded label Apr 26, 2017
mjbvz added a commit to mjbvz/vscode that referenced this issue May 5, 2017
**Bug**
89da6ab fixed microsoft#11944 by changing how enter works in completion providers. Now if the completion exactly matches the current text, pressing `enter` is not captured by the the suggestion widget. Instead it inserts a new line into the editor. This broke the jsdoc completion provider which uses `''` as a placeholder insertion before calculating the actual insertion upon being accepted. This weird behavior is because of a of the current tsserver api

**Fix**
Change the insert text to a single space instead. This seems to fix this issue in my testing.
mjbvz added a commit that referenced this issue May 5, 2017
* Fix JSDoc Completion Provider

**Bug**
89da6ab fixed #11944 by changing how enter works in completion providers. Now if the completion exactly matches the current text, pressing `enter` is not captured by the the suggestion widget. Instead it inserts a new line into the editor. This broke the jsdoc completion provider which uses `''` as a placeholder insertion before calculating the actual insertion upon being accepted. This weird behavior is because of a of the current tsserver api

**Fix**
Change the insert text to a single space instead. This seems to fix this issue in my testing.

* Slightly more elegant fix
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality suggest IntelliSense, Auto Complete verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants