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

If Intellicode Whole Line Completions are displayed, the suggestions widget does not open #131940

Closed
juihanamshet1 opened this issue Aug 30, 2021 · 62 comments · Fixed by #132866
Closed
Assignees
Labels
feature-request Request for new features or functionality inline-completions
Milestone

Comments

@juihanamshet1
Copy link
Member

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

  • VS Code Version: 1.60.0-insider (user setup)
  • OS Version: Windows_NT x64 10.0.19043
  • List of extensions that you have installed: Visual Studio IntelliCode Completions

Steps to Reproduce:

  1. Open the attached .txt file, convert it to a typescript .ts file
    main.txt

  2. In line 5, type s= and you should see a gray text IntelliCode completion.

  3. When you type what the completion shows, and get to typing a dot, ".".

  4. When you type a ".", it is expected you see the suggestions widget. But the suggestions widget does not show up in the presence of gray text completion.

  5. GIF - completionsDrivenBug2

@juihanamshet1
Copy link
Member Author

@hediet

@juihanamshet1 juihanamshet1 changed the title If Inline Suggestions are displayed, the suggestions widget does not open If Intellicode Whole Line Completions are displayed, the suggestions widget does not open Aug 30, 2021
@hediet
Copy link
Member

hediet commented Aug 30, 2021

This is actually by design (the ghost text should not disappear when typing the text as suggested).
However, I want to change this so that autocomplete shows, but the item from the ghost text is preselected.

@hediet hediet assigned hediet and unassigned jrieken Aug 30, 2021
@hediet hediet added this to the September 2021 milestone Aug 30, 2021
@juihanamshet1
Copy link
Member Author

"the item from the ghost text is preselected", can you please clarify this? In the above scenario, since ".socket" is in the whole line completion, would "socket" be selected in the suggestions widget?

@hediet
Copy link
Member

hediet commented Aug 31, 2021

In the above scenario, since ".socket" is in the whole line completion, would "socket" be selected in the suggestions widget?

Yes, when the autocomplete opens automatically while the cursor is in ghost text, the preselected item should agree with the ghost text.
Otherwise the ghost text will just disappear when the autocomplete opens.

@juihanamshet1
Copy link
Member Author

That sounds great! Do you have an estimate as to when this would be implemented?

@hediet
Copy link
Member

hediet commented Sep 5, 2021

Do you have an estimate as to when this would be implemented?

This milestone hopefully (i.e. early October).

@hediet
Copy link
Member

hediet commented Sep 7, 2021

Early prototype:
recording

@juihanamshet1 @Krzysztof-Cieslak @orph what do you think about this?
The suggest widget would no longer hide, but the inline suggestion is preselected, so that the ghost text does not disappear.

@hediet hediet added feature-request Request for new features or functionality inline-completions labels Sep 7, 2021
@Krzysztof-Cieslak
Copy link
Contributor

There's no guarantee that result returned by the Copilot is in the list of the completions for given location

@hediet
Copy link
Member

hediet commented Sep 7, 2021

There's no guarantee that result returned by the Copilot is in the list of the completions for given location

You mean that a non-empty prefix of a copilot suggestion appears in the suggest widget?
Do you have an example where that could be problematic?

hediet added a commit that referenced this issue Sep 10, 2021
…matically opening anymore if suggest preview is enabled. Instead, the first inline suggestion is used to preselect an item in the suggest widget.
@hediet
Copy link
Member

hediet commented Sep 14, 2021

@Krzysztof-Cieslak @juihanamshet1 the feature will be available in tomorrows insiders build of VS Code.
I would love to hear your feedback!

@hediet hediet added the verification-needed Verification of issue is requested label Sep 27, 2021
@lramos15 lramos15 added on-testplan and removed verification-needed Verification of issue is requested labels Sep 28, 2021
@lramos15
Copy link
Member

I see there's a test plan item for this so marking as on-tesplan instead of verification-needed

@orph
Copy link

orph commented Sep 28, 2021

@hediet this is the first I've heard of this, sorry I missed it. Can you please verify that the InlineCompletionItem itself will be listed in the popup? Since we don't currently register a regular completion item handler, only the inline version, will this mean a valid inline completion will just stop displaying in order to show the completion popup?

/cc @Krzysztof-Cieslak @isidorn @hsenag

@hediet
Copy link
Member

hediet commented Sep 28, 2021

Since we don't currently register a regular completion item handler, only the inline version, will this mean a valid inline completion will just stop displaying in order to show the completion popup?

A "valid" inline completion item will only be not shown with this new behavior if no proper prefix of it is suggested by the autocomplete.
If no prefix of the inline completion is a valid auto-complete item, I think the inline completion is very likely to cause compile errors.

@hsenag
Copy link

hsenag commented Sep 29, 2021

If no prefix of the inline completion is a valid auto-complete item, I think the inline completion is very likely to cause compile errors.

@hediet I guess that might depend on how good the auto-complete info is for a particular language. Is this behaviour going to be enabled for all languages?

Also is there any event when an inline completion item gets rejected by this logic?

@hediet
Copy link
Member

hediet commented Sep 29, 2021

Is this behaviour going to be enabled for all languages?

Yes.

Also is there any event when an inline completion item gets rejected by this logic?

No - they are not rejected, simply just not shown.

I guess that might depend on how good the auto-complete info is for a particular language.

Do you have an example where this is not good?
I've been using this feature for 15 days now and it seems to work nicely with TypeScript.

@Shaun1
Copy link

Shaun1 commented Dec 21, 2022

Just stumbling upon this thread after trying out Copilot with Golang in VSCode for a few weeks now. I think @jonahkagan did a good job of outlining what an intuitive behavior should be, at least for my workflow. The Copilot suggestions are great most of the time but when I hit certain trigger points (such as a dot) I nearly always want to see what my valid available options are and select from them, rather than have a suggestion that may not be valid.

Maybe it's just me though. Just one more data point.

I don't see this mentioned anywhere here but an acceptable workaround is to manually trigger IntelliSense with a keyboard shortcut: Ctrl + space.

This might work for some people, personally I've gotten used to IntelliSense suggestions coming up automatically at certain points without having to remember to hit another key.

@lcrownover
Copy link

IMO, the best user experience would be having copilot code as list items in the suggestions window. Combine that with the suggestion-preview setting and you'd be able to mix and match LSP and Copilot suggestions.

Take a look at this neovim plugin to see examples of this exact behavior. It works very well!

@lukaszciastko
Copy link

I've been using Copilot for the past few weeks, and, this is, by far, the most annoying thing about it. Could you at least make Copilot suggest valid things?

For example, this is Copilot suggestion for the Flutter launch_url plugin:

Screenshot 2023-04-21 at 12 32 20

However, the LaunchMode has no such option:

enum LaunchMode {
  /// Leaves the decision of how to launch the URL to the platform
  /// implementation.
  platformDefault,

  /// Loads the URL in an in-app web view (e.g., Safari View Controller).
  inAppWebView,

  /// Passes the URL to the OS to be handled by another application.
  externalApplication,

  /// Passes the URL to the OS to be handled by another non-browser application.
  externalNonBrowserApplication,
}

This makes no sense, and it happens over and over again, making using Copilot very frustrating and slowing down development.

@josias-r
Copy link

Just gonna drop this here for Copilot users:

[
  {
    "key": "alt+right",
    "command": "editor.action.inlineSuggest.showNext",
    "when": "textInputFocus && inlineSuggestionVisible"
  },
  {
    "key": "alt+left",
    "command": "editor.action.inlineSuggest.showPrevious",
    "when": "inlineSuggestionVisible && textInputFocus"
  },
  {
    "key": "alt+down",
    "command": "editor.action.triggerSuggest",
    "when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly && !suggestWidgetVisible && inlineSuggestionVisible"
  }
]

These are the keybindings I use with vscode which really work great for me and solves this issue for me.

The important one is alt+down, this will show the suggestions (there is a default shortcut for that, but at least on a swiss keyboard it is HORRIBLE). And alt+down is just very intuitive for me -> open the dropddown.

The other two are to cycle through the copilot suggestions of you are not happy with the suggestion

@isidorn
Copy link
Contributor

isidorn commented May 5, 2023

This should be much improved in the latest VS Code Stable. Can you all please try it out and let us know how it behaves for you?
To be sure you get the behaviour make sure to set editor.inlineSuggest.suppressSuggestions: false in your settings.

Thanks all 👏
I will go ahead and close this issue, but I can reopen if we see there are still improvements to be made.

@isidorn isidorn closed this as completed May 5, 2023
@isidorn isidorn removed the under-discussion Issue is under discussion for relevance, priority, approach label May 5, 2023
@lcrownover
Copy link

Seems to behave much better!

@isidorn
Copy link
Contributor

isidorn commented May 5, 2023

@lcrownover can you provide some details. What makes it better for you? Thanks!

@lcrownover
Copy link

@isidorn I successfully get the suggestions dropdown (LSP, etc) while the copilot ghost text is shown in the background.
Behavior seems to match the preview in #131940 (comment).

I can hit enter or tab to accept the suggestion, then tab again to accept the copilot ghost text. (only needing one tab if no suggestion is shown).

@yangtzech
Copy link

This should be much improved in the latest VS Code Stable. Can you all please try it out and let us know how it behaves for you? To be sure you get the behaviour make sure to set editor.inlineSuggest.suppressSuggestions: false in your settings.

Thanks all 👏 I will go ahead and close this issue, but I can reopen if we see there are still improvements to be made.

@isidorn There are still times when I expect IntelliCode to suggest methods when I hit a dot, but only CoPilot's suggestions appear.

I have attempted this on both VSCode 1.78.2 (system setup) and 1.79.0-insider (system setup), along with GitHub Copilot Nightly v1.86.118. All plugins are up-to-date.

@sebous
Copy link

sebous commented Jun 1, 2023

This should be much improved in the latest VS Code Stable. Can you all please try it out and let us know how it behaves for you? To be sure you get the behaviour make sure to set editor.inlineSuggest.suppressSuggestions: false in your settings.

Thanks all 👏 I will go ahead and close this issue, but I can reopen if we see there are still improvements to be made.

@isidorn Trying the new behaviour and it seems to be still broken, if copilot suggestion kicks in before I hit the ., LSP suggestions are not shown

2023-06-01 13 38 05

Any idea what could be wrong?

env:

  • vscode 1.78.2 (stable) - all extensions disabled except for GH
  • GH copilot nightly v1.87.131
  • macOS 13.4
  • all extensions disabled except for copilot
  • all vscode settings commented out except for editor.inlineSuggest.suppressSuggestions: false

@hediet
Copy link
Member

hediet commented Jun 1, 2023

This should work for all extensions who don't set the suppressSuggestions flag in the returned inline completions result. Copilot sets it to true.

@sebous
Copy link

sebous commented Jun 2, 2023

@hediet So is there a way to get it working? Or do I have to choose between copilot and language server suggestions showing automatically (without using the suggestions shortcut)?
Thanks a lot

@EntilZha
Copy link

EntilZha commented Jun 8, 2023

What I'd really like to see are Copilot suggestions appearing in the intellisense dropdown, with configuration options on how many to show, the position in the list to use, etc (e.g., always insert the top copilot suggestion at the top, then N intellisense results, then Y copilot results, then the rest of intellisense). I think it would be worth re-opening this or creating a new issue to that end.

The real issue with the copilot UI is that it is fighting the already-mature intellisense dropdown rather than having suggestions appear there.

@MuhsinFatih
Copy link

I've set "editor.inlineSuggest.suppressSuggestions": false, and when tying a new word, it seems to work fine, but it still suppresses after adding a dot.
With copilot enabled:
2023-06-08 16 58 10

With copilot disabled:
2023-06-08 16 59 49

@lcrownover
Copy link

What I'd really like to see are Copilot suggestions appearing in the intellisense dropdown, with configuration options on how many to show, the position in the list to use, etc (e.g., always insert the top copilot suggestion at the top, then N intellisense results, then Y copilot results, then the rest of intellisense). I think it would be worth re-opening this or creating a new issue to that end.

The real issue with the copilot UI is that it is fighting the already-mature intellisense dropdown rather than having suggestions appear there.

I whole-heartedly agree with this.

@isidorn
Copy link
Contributor

isidorn commented Aug 21, 2023

Just to let you know that we have pushed a fix so that now suggest widget is NOT suppressed by default.
So this should work better with VS Code Insiders from tomorrow. And this will be included in next stable (start of September). Try it out and let us know what you think. Thank you!

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 inline-completions
Projects
None yet
Development

Successfully merging a pull request may close this issue.