-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Add prefix argument to Quickopen command (CTRL+P) #28617
Comments
I'd like to take this if no one else started working on it. @bizoo can you please elaborate just a little bit? |
The goal is only to fill the input with the given argument, everything else must works the same. Currently when I want to compile my Java code, I type "task Java:" and select the desired item in the list (I have A LOT of task for different purpose).
Could be used for different purpose, like filter the list of files: Thanks @cristianhosu for looking at it. edit: There's an example of command with arguments here |
@bizoo - finished. Can you have a look? or maybe @bpasero Edit: Still need to get used to working with git. chosu@CH-Acer:~/dev/GitContrib/vscode2$ npm run watch
[23:51:13] Node flags detected: --max_old_space_size=524288 undefined:252 npm ERR! Linux 4.4.0-79-generic npm ERR! Please include the following file with any support request: |
Hello @bizoo Args usually represents an array and is treated as such.
In the example the args will be an array where the first item will represent the prefix. @bpasero - can you also validate that this is a valid implementation, or should I create a new class QuickOpenArguments which should contain prefix and showOptions? |
I'm a little bit confused by how args in commands (and keybindings) works. From this example of "type" command, the argument is named, not an array. If you change the name of the argument of "type" command, it doesn't works anymore. But example from @bpasero is an array of arguments (couldn't find the implementation of "type" command to compare). |
- added command to watermark
This is now possible via:
|
Thanks @cristianhosu and @bpasero. May I ask a question ? |
@bizoo good point, I think it would be nice if you can assign a keybinding with a type that is filled into quick open command. If you want to have a look how that works, feel free. |
@bizoo this actually works:
|
@bpasero I expected it to works that way but didn't try it myself (I use the standard release). But my question is why this command get an array of params (actually only one), but some other command use an object:
I think the syntax of type command is better. |
That is up to the command to decide and the picker command accepts just a string (what else?). But agree, having an object would make it more explicit what the argument is used for. |
Verify: you can write an extension that programmatically triggers the vscode.commands.executeCommand('workbench.action.quickOpen', '>editor'); |
Add an argument (prefix) to "workbench.action.quickOpen" command.
This way you can populate the content with predefined values ("task JS:", "view_", ...) to filter the result using different keybinding.
I think the quickOpenService.show() method has already a prefix argument, so all we need to do is add it to the registered command.
The text was updated successfully, but these errors were encountered: