microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.64k stars 29.04k forks source link

[editor.quickSuggestions] pop up to first suggestion out of sudden #224607

Closed kareemaboueid closed 2 months ago

kareemaboueid commented 2 months ago

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

when Suggestions menu opens and proceed to select a suggestion it pop up to first one out of sudden automatically

https://github.com/user-attachments/assets/2806e5e3-11f5-49b3-a366-9cdb8c7e5320

jrieken commented 2 months ago

Sorry, I cannot follow the recording. Please write out steps and what the expected behaviour is

kareemaboueid commented 2 months ago

when the suggestions menu opens, I go down with the down arrow key to choose an option in the suggestions, while doing that, the menu reset to the first suggestion option, and every time I go down or even scroll by the mouse wheel, it does the same behavior.

Steps:

1- write a normal code. 2- The suggestions menu opens automatically or by hitting Ctrl + Space 3- I go down to see more suggestions and options and decide to choose one by clicking on the Enter key. 4- Just before hitting the Enter or even if I'm still going down, the menu reset itself to be in the first state and stops on the first option.

kareemaboueid commented 2 months ago

I made another showcase video, I hope it's clear my point

https://github.com/user-attachments/assets/9b10f85d-5b33-4f77-a85d-610cc1b54c15

jrieken commented 2 months ago

Thanks for the clarification. Can't repro on my machine. Two things

  1. Can you enable trace logging (F1 > Set Log Level > Trace) and share the window logs (F1 > Show Logs > Window). Looking for messages like this but please share the whole trace
2024-08-08 17:18:59.727 [trace] KeybindingService#dispatch ↓ [ Will dispatch command selectNextSuggestion ]
2024-08-08 17:18:59.728 [trace] CommandService#executeCommand selectNextSuggestion
  1. try to disable extensions and see if the problem still exists. You can use Extension Bisect for this (F1 > Start Extension Bisect)
kareemaboueid commented 2 months ago

So, I did exactly what you said, and from the trace log below:

at Function.keys (<anonymous>)
    at Object.provideCompletionItems (c:\Users\<MY-USERNAME>\.vscode\extensions\roerohan.mongo-snippets-for-node-js-1.3.12\dist\extension.js:75998:24)
    at ye.provideCompletionItems (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:115716)
    at c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:141995
    at De.s (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:133052)
    at De.$provideCompletionItems (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:141981)
    at E.S (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:5980)
    at E.Q (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:5746)
    at E.M (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:4739)
    at E.L (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:3605)
    at i.value (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:2297)
    at n.B (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:737)
    at n.fire (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:954)
    at s.fire (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:97:14453)
    at i.value (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:177:8655)
    at n.B (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:737)
    at n.fire (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:954)
    at s.fire (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:97:14453)
    at MessagePortMain.<anonymous> (c:\Users\<MY-USERNAME>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:177:6781)
    at MessagePortMain.emit (node:events:519:28)
    at MessagePortMain.emit (node:domain:488:12)
    at Object.MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:2285)
2024-08-08 23:21:52.739 [trace] [DEBOUNCE: InlineCompletionsDebounce] for file:///c%3A/Users/<MY-USERNAME>/Documents/portfolio/todo-app/app/User/controllers/user_login.js is 50ms

I spotted the extension that is causing the problem.

it is roerohan.mongo-snippets-for-node-js

I uninstalled it. and the problem is solved.

Thank you so much for your help. I really appreciate it Mr. @jrieken

jrieken commented 2 months ago

@kareemaboueid Thanks for the quick response and good to know you are unblock. Drilled into this a little and it seems that the extension unregisters and registers it completion item providers periodically. The UI (VS Code) will then recompute the list and this is what apparently happens