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

^acceptSelectedSuggestion no longer works #4269

Closed
jseanxu opened this issue Mar 15, 2016 · 7 comments
Closed

^acceptSelectedSuggestion no longer works #4269

jseanxu opened this issue Mar 15, 2016 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority verified Verification succeeded
Milestone

Comments

@jseanxu
Copy link

jseanxu commented Mar 15, 2016

  • VSCode Version: 0.10.11
  • OS Version: Win10

Steps to Reproduce:

  1. Open keybindings.json
  2. Add this key binding:
{ "key": "space", "command": "^acceptSelectedSuggestion", "when": "editorTextFocus && suggestWidgetVisible" }
  1. Open a code file (C#, JS, TS)
  2. Type "publ" followed by the space key

Expected:
The text should be public (with a space at the end)

Actual:
The text is publ, no autocompletion occurred.

Note:
"acceptSelectedSuggestion" without the caret still works

@jseanxu
Copy link
Author

jseanxu commented Mar 15, 2016

Looking thru the default bindings, I noticed this binding at the very bottom of the file:

{ "key": ".", "command": "^acceptSelectedSuggestion", "when": "editorTextFocus && suggestWidgetVisible && editorLangId == 'typescript' && suggestionSupportsAcceptOnKey" }

Pressing . does not autocomplete in TypeScript either.

@alexdima alexdima added the bug Issue identified by VS Code Team member as probable bug label Mar 16, 2016
@alexdima alexdima added this to the March 2016 milestone Mar 16, 2016
@alexdima
Copy link
Member

I can confirm it doesn't work on TypeScript due to the context key suggestionSupportsAcceptOnKey not being set.

@alexdima alexdima assigned jrieken and unassigned alexdima Mar 16, 2016
@jrieken
Copy link
Member

jrieken commented Mar 16, 2016

There is two problems:

  1. this commit introduced a regression in that it turns around the boolean condition (missing !) 2461331
  2. we ended up with having the command two times when working on the acceptOnEnter config setting

@jrieken
Copy link
Member

jrieken commented Mar 16, 2016

@joaomoreno @alexandrudima Despite the fixes above this still happens. The reason seems to be that suggestWidget#onListSelection uses a timeout. That gives the triggerOnCharacter command a chance to run (and clear the previous suggest model) such that accept doesn't work

@jrieken
Copy link
Member

jrieken commented Mar 16, 2016

the timeout and like breakage happened in 6b49547

@jrieken jrieken assigned joaomoreno and unassigned jrieken Mar 16, 2016
@jrieken jrieken added the important Issue identified as high-priority label Mar 16, 2016
joaomoreno added a commit that referenced this issue Mar 16, 2016
@joaomoreno
Copy link
Member

Oh, the missing !! Ugh, sorry about that.

The setTimeout was just a leftover. I made a change that enables me to simply remove it. 👍

@jrieken can you see whether the acceptSelectedSuggestion now works?

@joaomoreno joaomoreno assigned jrieken and unassigned joaomoreno Mar 16, 2016
@jrieken
Copy link
Member

jrieken commented Mar 16, 2016

works

@jrieken jrieken closed this as completed Mar 16, 2016
@jrieken jrieken added the verified Verification succeeded label Mar 21, 2016
@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
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants