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

Allow showing intellisense without pre-selected item #151336

Closed
avneraa opened this issue Jun 6, 2022 · 18 comments
Closed

Allow showing intellisense without pre-selected item #151336

avneraa opened this issue Jun 6, 2022 · 18 comments
Assignees
Labels
feature-request Request for new features or functionality suggest IntelliSense, Auto Complete verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@avneraa
Copy link

avneraa commented Jun 6, 2022

In Kusto we have a desktop tool (http://aka.ms/ke) using Dev Express libraries where the IntelliSense does not pre-select any of the items, and any key that is not alphanumeric dismisses the IntelliSense without committing anything. We find this behavior much more intuitive and friendly for authoring Kusto queries.

Here is an example of the two behaviors:

In Kusto explorer, hitting enter or any other key will dismiss the intellisense:

image

While in Monaco hitting enter will commit the “and” requiring the user to either hit escape of delete the committed text:

image

Thanks Avner Aharoni

@lidermanrony
Copy link

lidermanrony commented Jun 6, 2022

A finer point to note is that in Kusto desktop tool, if intellisense was triggered by the user, the value is preselected.
Only if the intellisense is triggered programmatically it is not preselected.

so we need to have this mode only when calling editor.trigger (somehow need to have this as a parameter to the call

editor.trigger('monaco-kusto', 'editor.action.triggerSuggest', {})

@jrieken jrieken added this to the Backlog Candidates milestone Jun 7, 2022
@jrieken jrieken added feature-request Request for new features or functionality suggest IntelliSense, Auto Complete labels Jun 7, 2022
@jrieken jrieken modified the milestones: Backlog Candidates, June 2022 Jun 10, 2022
@jrieken jrieken added the under-discussion Issue is under discussion for relevance, priority, approach label Jun 10, 2022
@jrieken
Copy link
Member

jrieken commented Jun 10, 2022

Let's use June to figure out how this should work and how this should be done. Might also be interesting to explore if inline completions (aka ghost text) can be used here

@microsoft microsoft deleted a comment from vscodenpa Jun 10, 2022
@jrieken jrieken modified the milestones: June 2022, July 2022 Jun 20, 2022
@jrieken
Copy link
Member

jrieken commented Jul 5, 2022

  • add argument to editor.action.triggerSuggest to have suggest widget without selection @jrieken
  • optional play with inline completion for optional kusto compltion @avneraa

jrieken added a commit that referenced this issue Jul 6, 2022
This allows to trigger suggest (as normal) but not select an item, #151336
jrieken added a commit that referenced this issue Jul 6, 2022
…54251)

This allows to trigger suggest (as normal) but not select an item, #151336
@jrieken
Copy link
Member

jrieken commented Jul 7, 2022

fyi @lidermanrony lastest bits in main support a noSelection-argument, e.g with editor.trigger('monaco-kusto', 'editor.action.triggerSuggest', { noSelection: true }) you should be able to trigger suggest without an (initial) selection

@jrieken jrieken modified the milestones: July 2022, August 2022 Jul 22, 2022
@jrieken
Copy link
Member

jrieken commented Aug 24, 2022

@lidermanrony @avneraa do those changes work for you? Did we reach happyness?

@jrieken jrieken modified the milestones: August 2022, September 2022 Aug 24, 2022
@gjsjohnmurray
Copy link
Contributor

Sort of related to this, can #85768 be reconsidered? It didn't get enough upvotes when a Backlog Candidate a couple of years ago.

@jrieken jrieken modified the milestones: September 2022, October 2022 Sep 23, 2022
@jrieken jrieken removed this from the October 2022 milestone Oct 4, 2022
@gil-koifman
Copy link

Hi,
We want to to have this noSelection option whenever the user is pressing the "triggerCharacters" in the CompletionProvider.
Lets say the trigger character is a space character, then we want to be able to configure that after pressing the space character, and showing the completion items, then there will be nothing selected by default.
But if the user has started typing, or is in the middle of the word, then we do want the best option to be preselected.

Is it possible to expose us this kind of mode?
Thanks!

@avneraa
Copy link
Author

avneraa commented Nov 3, 2022 via email

@jrieken
Copy link
Member

jrieken commented Nov 3, 2022

@gil-koifman @avneraa Just to clarify: assuming this is an editor option (noSelectOnTriggerCharacter and noSelectOnQuickSuggest) would you still need the noSelection argument (#151336 (comment)) or can I remove that again?

@gil-koifman
Copy link

@jrieken That depends.. Will "noSelectOnQuickSuggest" take care of this for us? We do still need the ability to manually trigger the completion list using the trigger "editor.action.triggerSuggest", and have the no selection capability with it.

@jrieken
Copy link
Member

jrieken commented Nov 7, 2022

Yeah, should still be possible. The editor.action.triggerSuggest command accepts an auto-flag which will tell it to act as if quick suggest is on

@jrieken jrieken added this to the November 2022 milestone Nov 8, 2022
@jrieken
Copy link
Member

jrieken commented Nov 8, 2022

Sort of related to this, can #85768 be reconsidered? It didn't get enough upvotes when a Backlog Candidate a couple of years ago.

@gjsjohnmurray Will be similar but not a selection mode. It will be an option that's only applicable for auto-suggest (quick suggest and trigger characters)

jrieken added a commit that referenced this issue Nov 9, 2022
…ch makes suggest items not be selected when triggered automatically (quick suggest and trigger characters)

#151336
@jrieken
Copy link
Member

jrieken commented Nov 24, 2022

This is done and behind the (non documented) editor.suggest.selectQuickSuggestions options. fyi @avneraa @gil-koifman

@jrieken jrieken closed this as completed Nov 24, 2022
@jrieken jrieken added the verification-needed Verification of issue is requested label Nov 25, 2022
@jrieken
Copy link
Member

jrieken commented Nov 25, 2022

To verify

  • set the setting editor.suggest.selectQuickSuggestions: false
  • trigger suggest manually (ctrl+space) and make sure there is a focused suggestion
  • trigger suggest automatically, via typing or via trigger character, and make sure no suggested is focused. press ctrl+space again and ensure a suggestion is now focused

@jrieken jrieken removed the under-discussion Issue is under discussion for relevance, priority, approach label Nov 25, 2022
@gil-koifman
Copy link

gil-koifman commented Nov 28, 2022

@jrieken
Hey, thanks for this change, I verified and it worked.
There is a tweak though that is missing for our requirement:
If the user pressed the "triggerCharacters", in our case it's "space", then when the suggestion list shows - nothing will be selected. This is implemented in your solution.
But if the user started typing something, or started deleting characters from an existing word, then we do want the first option to be selected. In the above solution, nothing will be selected.

@isidorn isidorn added the verified Verification succeeded label Nov 29, 2022
@isidorn
Copy link
Contributor

isidorn commented Nov 29, 2022

Works as expected -> verified.
However the setting is hidden, it can not be discovered by the users. @jrieken is this expected?

@jrieken
Copy link
Member

jrieken commented Nov 30, 2022

it can not be discovered by the users. @jrieken is this expected?

Yeah, for now it is just a monaco editor thing

@jrieken
Copy link
Member

jrieken commented Dec 1, 2022

But if the user started typing something, or started deleting characters from an existing word, then we do want the first option to be selected. In the above solution, nothing will be selected.

@gil-koifman Can you please create a new issue for that. Thanks

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 suggest IntelliSense, Auto Complete verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants