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

Use editor.suggest.preview without quick suggestions #126375

Closed
svipas opened this issue Jun 15, 2021 · 25 comments
Closed

Use editor.suggest.preview without quick suggestions #126375

svipas opened this issue Jun 15, 2021 · 25 comments
Assignees
Labels
feature-request Request for new features or functionality inline-completions on-release-notes Issue/pull request mentioned in release notes on-testplan suggest IntelliSense, Auto Complete
Milestone

Comments

@svipas
Copy link
Contributor

svipas commented Jun 15, 2021

Hello @hediet @jrieken @alexdima. I really like new setting editor.suggest.preview, but I'm wondering if it's possible to make these previews available even with quick suggestions disabled? It could be really powerful with editor.tabCompletion: "on", because you would see suggestion as you type and you can simply hit 'Tab' to resolve it.

@vscodebot
Copy link

vscodebot bot commented Jun 15, 2021

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@hediet
Copy link
Member

hediet commented Jun 16, 2021

Support for tabCompletion is tracked in #125328!

@hediet hediet added the *duplicate Issue identified as a duplicate of another issue(s) label Jun 16, 2021
@svipas
Copy link
Contributor Author

svipas commented Jun 16, 2021

@hediet What I mean is be able to see previews without quick suggestions, because if I disable them I cannot see previews. I can see them only with quick suggestions enabled. It would be very amazing, because finally in this case I could totally disable quick suggestions, especially in code-bases where I know things 🙂

@hediet
Copy link
Member

hediet commented Jun 16, 2021

This also agrees with my vision on how tabCompletion: on should work with editor.suggest.preview!

@svipas
Copy link
Contributor Author

svipas commented Jun 16, 2021

@hediet Amazing news!

@hediet
Copy link
Member

hediet commented Jun 17, 2021

After having a closer look at the problem described in #125328, I think this issue really is a different feature request. I will reopen it to track it separately.

Unfortunately, if the suggest widget is hidden, completion items are not queried anymore (they are queried on demand when you press "tab" if tab completions are turned on).
Currently, the preview uses the data from the widget, so for this feature, the preview controller would either need to keep the suggest model alive all the time or it needs to query the completion items on its own.
Both options are quite involved, so I'm moving this feature to the backlog for now.

@hediet hediet reopened this Jun 17, 2021
@hediet hediet added feature-request Request for new features or functionality inline-completions and removed *duplicate Issue identified as a duplicate of another issue(s) labels Jun 17, 2021
@hediet hediet added this to the Backlog milestone Jun 17, 2021
@svipas
Copy link
Contributor Author

svipas commented Dec 7, 2021

@hediet Copilot can do this with editor.quickSuggestions -> false. I really like to turn off quick suggestions and as I type see inline suggest and simply press tab to auto-complete. I really want this feature and I believe it would be valuable to others, how I can help to push this forward?

Basically what I expect is to see inline suggest with editor.quickSuggestions -> false & editor.inlineSuggest.enabled -> true. You could look at screenshot below, this is how it looks like with Copilot, I expect the same inline suggest, but without Copilot.

Screen Shot 2021-12-08 at 00 37 53

P.S. Please tell me what should I change to at least compile VS Code by myself to have this functionality.

@hediet
Copy link
Member

hediet commented Dec 8, 2021

I really want this feature and I believe it would be valuable to others, how I can help to push this forward?

Unfortunately, this is not trivial at all. You need a completion session to know what items there are to suggest. editor.suggest.preview: true just connects to the existing completion session.
But the requested feature requires inline completions to actually create a new completion session, which is not trivial.

@svipas
Copy link
Contributor Author

svipas commented Dec 8, 2021

@hediet Yeah I understand that and I now know the difference between editor.suggest.preview and inline suggestions. So basically to achieve what I want is to simply not show suggest widget, but keep the suggest model active. So we are kinda taking about even maybe new setting, because current completions do not register as inline completions. Anyways, I hope someday we could have this feature, because it's just amazing, you could simply disable quick suggest widget and while typing you could see those "inline" completions as you type. The reason why I think it's really good feature request is because it minimizes distraction and especially it's good if you know codebase. Look at Copilot, it doesn't add those completions to suggest widget, but simply uses inline completions, why not do that for all completions and maybe register 2 providers (inline & simple) so we could have this feature out-of-the box.

To go back to question @hediet do you consider this feature request reasonable? If yes, could I help to implement this? I don't know which correct way it would be, a new setting? Register completions as inline completions (in this case there would be 2 completion providers and what about Copilot since it uses inline completions)?

I know you guys have a lot of stuff going on, but I hope one day we will have this.

@hediet
Copy link
Member

hediet commented Dec 8, 2021

do you consider this feature request reasonable?

I would like to have it too, but I currently don't have the time to work on it.

If yes, could I help to implement this?

You could try, but it will be hard and would even take me a couple of days. I don't have the time to assist you here.

Long term, you could look out for help-wanted issues and work on them, that would help us a lot (look at this query for more issues).
I cannot promise anything, but if we don't have to spent so much of our time on all those "easy" issues, it is much more likely that we find time to work on non-trivial issues like this.

@jrieken
Copy link
Member

jrieken commented Feb 9, 2022

Idea would be to tweak the setting like so: editor.quickSuggestions -> true | "inline" | false . The true means "suggestions as you type, presented with the suggest widget", and "inline" means "suggestions as type, presented via inline text"

@svipas
Copy link
Contributor Author

svipas commented Feb 9, 2022

@jrieken Amazing idea! I really like it 👍

@jrieken jrieken self-assigned this Feb 11, 2022
@jrieken
Copy link
Member

jrieken commented Feb 11, 2022

@hediet I can help with this but inline completions need to become a little more powerful, like support for snippets

@svipas
Copy link
Contributor Author

svipas commented Mar 17, 2022

I just saw that this issue is included in current iteration plan (March 2022). This is amazing news! Thanks a lot @jrieken & @hediet!!! 🥳

@jrieken
Copy link
Member

jrieken commented Mar 18, 2022

First cut of this is in #145386

Screen.Recording.2022-03-18.at.11.22.54.mov

@svipas
Copy link
Contributor Author

svipas commented Mar 18, 2022

@jrieken Looks amazing!

Is it possible to make inline suggestions after . as well? Or it should work by adding "editor.suggestOnTriggerCharacters": false into settings ? console was inline, but after pressing . you got completion widget, it would be nice to be able to use inline completions afterwards instead of seeing completion widget. Why? Completely use inline suggestions, because if you use them you probably know codebase well and if you don't know you could simply hit ctrl + space to see completion widget.

@jrieken
Copy link
Member

jrieken commented Mar 18, 2022

Or it should work by adding "editor.suggestOnTriggerCharacters": false into settings

Yeah, you will need to use that config. For us quick suggest and trigger characters are separate and they shouldn't be married with this feature. Tho, I can confirm that things nice with it off.

Screen.Recording.2022-03-18.at.12.49.53.mov

@svipas
Copy link
Contributor Author

svipas commented Mar 18, 2022

That is awesome! Thanks a lot! ❤️

@jrieken
Copy link
Member

jrieken commented Mar 18, 2022

merged so this can be tried in next insiders

@gjsjohnmurray
Copy link
Contributor

New settings give lots of flexibility but can't be handled by Settings Editor GUI, and look a bit cryptic when editing as JSON

image

@jrieken
Copy link
Member

jrieken commented Mar 21, 2022

Even before it couldn't be handled by the setting UI and all my attempts to simplify this setting didn't result in a working UI. @roblourens @rzhao271 this setting might be boss enemy of the UI and I am happy to accept any advice to make this better

@svipas
Copy link
Contributor Author

svipas commented Mar 22, 2022

@jrieken Thanks a lot for implementing this feature, I did some testing and found out 2 issues, I'm not quite sure if you can call them "issues" maybe it's expected to work like this.

If you look at the gif below, you will see when I write co I see cancelAnimationFrame and it quickly changes to confirm, but if use suggest widget this doesn't happen. And, the last one is when I use snippet log it have strike like it is deprecated (same happens in Settings, so I would say for all snippets).

Recording 2022-03-22 at 11 12 56

@jrieken
Copy link
Member

jrieken commented Mar 22, 2022

Yeah, we have a few follow-up items to make this "less nervous". The different between inline completions and "normal" completions is that the former are recomputed on each key stroke. For inline quick suggestions some caching is happening but due to UI debounce and things this isn't ideal yet. We are on it

@svipas
Copy link
Contributor Author

svipas commented Mar 22, 2022

Very good to know, I'm really excited for this to land 🙂

@jrieken jrieken added the on-release-notes Issue/pull request mentioned in release notes label Mar 24, 2022
@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2022
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 on-release-notes Issue/pull request mentioned in release notes on-testplan suggest IntelliSense, Auto Complete
Projects
None yet
Development

No branches or pull requests

5 participants
@jrieken @hediet @gjsjohnmurray @svipas and others