Skip to content

suggestion menu should not automatically select the first suggestion #67698

@alexch

Description

@alexch

VS Code version: Code 1.30.2 (61122f8, 2019-01-07T22:48:31.260Z)
OS version: Darwin x64 17.7.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-2677M CPU @ 1.80GHz (4 x 1800)
GPU Status 2d_canvas: unavailable_software
checker_imaging: disabled_off
flash_3d: unavailable_software
flash_stage3d: unavailable_software
flash_stage3d_baseline: unavailable_software
gpu_compositing: unavailable_software
multiple_raster_threads: unavailable_off
native_gpu_memory_buffers: unavailable_software
rasterization: unavailable_software
video_decode: unavailable_software
video_encode: unavailable_software
webgl: unavailable_off
webgl2: unavailable_off
Load (avg) 2, 3, 3
Memory (System) 4.00GB (0.04GB free)
Process Argv .
Screen Reader no
VM 0%
Extensions (3)
Extension Author (truncated) Version
vscode-eslint dba 1.8.0
dotenv mik 1.0.1
vsliveshare ms- 0.3.1151

Steps to Reproduce:

  1. open a JS file
  2. type cy.get( at a rate sufficient for the suggestion menu to appear
  3. notice that crypto.getRandomValues( appears instead

Does this issue occur when all extensions are disabled?: Yes


In JavaScript, when I type cy.get( and then look at the screen I should see cy.get(. Instead I (sometimes!) see crypto.getRandomValues( instead.

This is an #a11y issue; the suggestion menu should not select or fill anything until/unless I press while it's up. Any setting that takes control away from the user and types extra characters that they did not intend is a bad default setting, and the fact that this behavior is timing-dependent is even more maddening.

I note that similar bugs have been reported before and not fixed. Please reconsider. I teach programming classes and in every class so far, the majority of students find this behavior astonishing and frustrating; power users who prefer it should be competent enough to change a setting to their preference, but (I repeat) the default behavior of a text editor should be to faithfully enter the keys that were typed.

A common answer to this problem is to disable the acceptSuggestionOnCommitCharacter and/or acceptSuggestionOnEnter settings, but this bug is really about the default values of those settings being wrong for most users.

Also, the editor.acceptSuggestionOnCommitCharacter setting sounds like it's intended to type the selected suggestion and a dot when I press ., which is actually desirable behavior; the advice to disable editor.acceptSuggestionOnCommitCharacter is more of a workaround than a solution since it disables .-to-accept in all cases, not just this overly-aggressive autocomplete scenario.

Is this issue sufficient to track both the fact that this setting is wrong by default, and that you might need a new setting e.g. "automaticallySelectFirstSuggestion" (which should also be false by default)?

Related issues:

Metadata

Metadata

Assignees

Labels

*duplicateIssue identified as a duplicate of another issue(s)suggestIntelliSense, Auto Completeunder-discussionIssue is under discussion for relevance, priority, approach

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions