Make prefill in quick open configurable#41586
Make prefill in quick open configurable#41586ColCh wants to merge 17 commits intomicrosoft:masterfrom
Conversation
|
Have you tried to invoke
You've already made similar PR in Atom => and you hid functionality under configuration and turned it off by default. What is different now? Multi-line: in your Atom PR when having multi-line selection you don't prefill the input, right? Seems more logical to me to skip multi-line selections here too... |
wow thank you! didn't expected this case. Fixed
That behaviour was requested by member of Atom. Personally, I think that this feature should be turned ON by default and be unconfigurable. What do you think? Webstorm has this feature as well. And AFAIK there is no config to turn it off. Hm... I think it will be useful to control this feature I will create 2 config entries:
Agreed. Skipped that too. Fixed. Thank you! |
| } | ||
|
|
||
| private shouldPrefill(prefix?: string): boolean { | ||
| const isTurnedOn = this.configurationService.getValue('workbench.quickOpen.prefillFromSelection') as string; |
There was a problem hiding this comment.
This is boolean, right?
|
|
||
| const prefillsPrefix = prefixes.indexOf(prefix) !== -1; | ||
|
|
||
| return prefillsPrefix; |
There was a problem hiding this comment.
Could've been one line?
return prefixes.indexOf(prefix) !== -1;
There was a problem hiding this comment.
yeah
corrected to be one line
| 'type': ['string', 'null'] | ||
| }, | ||
| 'default': [ | ||
| null, |
There was a problem hiding this comment.
Not obvious for what null stands for.
There was a problem hiding this comment.
null prefix is in file quick open
There was a problem hiding this comment.
Then ... what for empty string?
There was a problem hiding this comment.
it seems that empty string has no reason to be here
removed it
There was a problem hiding this comment.
I thought maybe it would be better to remove null from config and use empty string (since empty string is the value in quick picker associated with go to file) - map it to null in code.
|
@ColCh I see two possible solutions:
My reason why I would never want this as default is that our quick open includes a list of recently opened editors in order of their appearance. This list would not show up anymore as soon as some text is prefilled based on the selection in the editor. Btw we have code that gets selection from the editor for the "Open Symbol in Workspace" quick open handler already, check out: https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/search/electron-browser/search.contribution.ts#L268 |
|
@bpasero thanks for suggestions and link to code Ok, seems reasonable to turn on this feature only for search for all symbols, which is
Feature implemented in current PR prefills on I will remove prefill logic from |
* master: implement closeEditors properly when passing in editors
|
Done, please check again |
* master: (280 commits) fix issue with useAltAsMultiSelectModifier Log ripgrep cmd from quickopen to logservice Switch search output panel to logservice Use absolute paths for webview core resources Explicitly hide TS version status when in ts/js file with unknown scheme First attempt of search caching. Pick up latest TS insiders 2018-01-19. Merged in translations from Transifex. Avoid double-counting same settings search query Use latest emmet helper that has fixes microsoft#33818 Remove settings search @groupId filters - since group ids can now be extension guids, and nobody uses this anyway backups - make sure to use "utf8" as encoding and not "utf-8" Catch any errors that onLineData users throw use uuid as extensions configuration id fix format on save problem that occurs when a provider returns no edits fix microsoft#41724 Fix microsoft#41868 some menu polish for issue reporter Fix microsoft#40260 Simplify edits handling in TextModelTokens ...
|
Build is failing on Travis, but it seems that I can't clearly understand why it's failing... |
|
@bpasero ping? |
|
This change is not what I was expecting. I think I was expecting either a setting for just quick open (Cmd+P) or just a new command that would do this (I think a new command would be better). |
|
Thank you for your thoughts
This will introduce same logic as symbol search across the project with different implementation. I just think that having single place of handing input prefill is better, isn't it?
Hm, interesting proposal. You mean, one command will open command menu with defined prefix (quick open, symbol search, other ...) and will append selected text, and another command, which will just open command menu without prefill (like now) ? Ok, I will code this. AFAIK only symbol search across the project now prefills selected text? Any other points to consider? |
|
@ColCh yeah we could add a new quick open command similar to Cmd+P today that puts the selection in. If there is any code to share between open symbols and open file, that would be good. |
|
@ColCh you could also do this from an extension, see my comment in #10413 (comment) |
|
@bpasero ooh thank you so much for that snippet! It seems that this functionality should not exist in core, but in extension, right? |
|
@ColCh yeah let's start with an extension 👍 |
Close #41725
Demo: https://streamable.com/psso1