microsoft / vscode

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

Intellisense + Inline Completions interaction has flickering #166023

Closed juihanamshet1 closed 1 year ago

juihanamshet1 commented 1 year ago

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

Steps to Reproduce:

Have these internal settings enabled: "editor.inlineSuggest.allowQuickSuggestions": true, "editor.inlineSuggest.allowSuggestOnTriggerCharacters": true   The Intellisense interaction with grey text is awesome! But I noticed some flickering. Here is the GIF. intellisense_intellicode_internalsetting_flashing

I grabbed screenshots to make the flickering clear:   WLC prediction is in Italics  image

When Intellisense is up, Intellisense text is in Italics and wlc prediction is not.   image

When .is typed, there is a small latency where wlc prediction disappears. This is because . is a trigger character for Intellisense so first it will process Intellisense and then request the wlc inlineCompletionProvider.   image

After that small latency, the wlc prediction shows up again in Italics  image

So, the 2 main problems here are  1) When Intellisense pops up while walking the prediction, the prediction goes from Italics to non-Italics. It goes back to Italics when Intellisense is dismissed (either by manual dismissal or item committed). In VS, we keep the font for grey text the same regardless of whether Intellisense is up or not, that would be helpful in VS Code. 2) The small delay that happens when a trigger character is hit and the wlc prediction disappears and comes back again.

cc @hediet

divineniiquaye commented 1 year ago

This is normal, I use Copilot and experience the same thing. I believe this is not a bug but a slight delay in rendering.

hediet commented 1 year ago

I cannot reproduce:

Code_-_OSS_vWTDVC1Bbf

Please log all calls from VS Code into your implementation of the inline completions provider and send me that log.

juihanamshet1 commented 1 year ago

inlineCompletionProviderLogs.txt

Here are the logs, lmk if you need anything else.

juihanamshet1 commented 1 year ago

I was able to repro the bug in code-oss. ghostText is indeed undefined when the flickering happens.

I captured a GIF of the logs so you can see at what point ghostText becomes undefined. ghostText_undefined

Here are the logs ghostText_undefined_logs.txt

juihanamshet1 commented 1 year ago

I was also able to repro this bug in the sample extension. I used the extension from here - https://github.com/microsoft/vscode-extension-samples/tree/main/inline-completions

flickering_toyExtension

bhavyaus commented 1 year ago

Verified that inline completions do not flicker anymore.