-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
Inline Suggestions: Support Interaction With Suggest Widget #129495
Comments
This looks awesome! I'm super excited. Imagine an experience where showing grey text suggestions (i.e. from Copilot) isn't blocked when the completions list is open. This could also be super helpful for scenarios where the whole line suggestion isn't entirely correct; this seems to happen more often for ReactJS's where there's a lot of method chaining. I would use the completions list to incrementally write code, which would then update the grey text/whole line suggestion |
This is our current idea:
|
Hey! This looks great! Based on dogfooding of the current experience from different members of the team, we really believe that this would contribute to a huge improvement Copilot, Intellicode, and other extensions that could use this API! A couple thoughts here!
CC'ing @DavidObando @vivlimmsft @iampiyusharora for input |
I would love to see a demo! I understand what you are asking, but I have problems imagining how this feature should work.
Can you elaborate on this?
Yes, we discussed some ideas here https://github.com/microsoft/vscode-internalbacklog/issues/2204 |
A quick update, this is what I have so far: It is very prototypish, so it is not available in insiders yet. The following extension code causes the demonstrated behavior: const provider = {
provideInlineCompletionItems: async (document, position, context, token) => {
if (context.selectedSuggestionInfo) {
await new Promise(r => setTimeout(r, 500));
return [{
text: `${context.selectedSuggestionInfo.text}('${context.selectedSuggestionInfo.text}')`,
range: context.selectedSuggestionInfo.replaceRange
}];
}
// ...
}
}; However, I don't like the style yet - it should be more obvious what is the suggestion ( |
Hey! Thanks for sharing the prototype, this is super exciting for VSCode users! RE: #1 (right arrow behaviour), our implementation in VS is not yet finalized. @iampiyusharora can comment on the intended design. RE: #2, please disregard; my wording was unclear and this seems to already have been addressed in the prototype. RE #3 (hinting), I don't seem to have permissions to see the repo. Would you mind adding myself and @iampiyusharora? RE #4 (suggestion vs inline completion display), I think @iampiyusharora has some comments on this. The current pattern in VS seems to be the opposite (suggestion window token is italicized, inline suggestion is normal). I wonder if this might be more obvious... either way we should agree on something to unify the experience between VS and VS Code! |
I think the style used for what you get when you hit "tab" should be consistent.
The text in
I moved the discussion here: #130550 |
My thoughts on it are: 🤩 that works for me! I'll let Aaron give us his impressions. One thing we might want to consider as well is the accessibility component of this. Do you have a plan on how this can be integrated with screen readers? I'm not familiar with VSCode's screen reader support. |
Hi team, Wanted to share some thoughts. For reference, the VS Win version has the following behavior: First point, in VS Win there's italicized text to preview the selected item from intellisense list, and normal case for whole line completions. Looking at the behavior described in the thread above, seems like VS Code has the opposite: The second point, the VS Win version has the hint text: Tab Tab to Commit, and VS Code doesn't. I think it would be a great idea from consistency standpoint to decide on a single direction between both products. Thanks |
Thanks for your thoughts!
That is intentional, as we currently don't want to make (Copilot) inline suggestions and the default suggestion preview italic. I think the style used for what you get when you hit "tab" should be consistent in these three cases: Inline Suggestion:
We are leaning towards something like this (a single Tab): After the uses presses a single tab, the tab will stay, indicating that the user can press tab twice. |
During an internal discussion, we came to the conclusion that this explicit highlighting is too much. I continued exploring ideas and prototyped this idea by @alexdima: This idea could be extended to support multiple such markers, each indicating a "tab stop" until which pressing "tab" would accept the inline suggestion. |
Implemented by #131183. |
Currently, the suggest widget does not show automatically when typing the text as shown by an inline suggestion.
Also, when the suggest widget is shown, the inline suggestion is hidden.
We should explore allowing inline suggestion providers to collaborate with the suggestion widget.
The text was updated successfully, but these errors were encountered: