You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add prefix argument to Quickopen command (CTRL+P) #28617
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.
I'd like to take this if no one else started working on it.
Should be a quick fix :)
Dominique Wahli (@bizoo) can you please elaborate just a little bit?
Once you press CTRL + P, the command input appears, then what is the next step?
As far as i can tell right now you have the option to view the tasks, recent files, got to symbol and others.
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).
I like to have a keybinding that open the quickOpen ("workbench.action.quickOpen") and prefill the input with "task Java:", something like (not sure if it's the correct syntax for "args"):
Edit: Still need to get used to working with git.
I've set my upstream and reset my master to the upstream/master and will redo the changes but now on master it throws an error while running:
chosu@CH-Acer:~/dev/GitContrib/vscode2$ npm run watch
npm ERR! Linux 4.4.0-79-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "watch"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] watch: gulp watch --max_old_space_size=524288
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch script 'gulp watch --max_old_space_size=524288'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the code-oss-dev package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! gulp watch --max_old_space_size=524288
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs code-oss-dev
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls code-oss-dev
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/chosu/dev/GitContrib/vscode2/npm-debug.log
In the example the args will be an array where the first item will represent the prefix.
Benjamin Pasero (@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.
And as I know next to nothing of VSCode code, I couldn't help.
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 Benjamin Pasero (@bpasero) is an array of arguments (couldn't find the implementation of "type" command to compare).
So is arguments of commands and keybindings different ?
Dominique Wahli (@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.
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 workbench.action.quickOpen command and you can pass over a string to show as prefix in the quick open picker. E.g.:
Activity
cristianhosu commentedon Jun 15, 2017
I'd like to take this if no one else started working on it.
Should be a quick fix :)
Dominique Wahli (@bizoo) can you please elaborate just a little bit?
Once you press CTRL + P, the command input appears, then what is the next step?
As far as i can tell right now you have the option to view the tasks, recent files, got to symbol and others.
bizoo commentedon Jun 15, 2017
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).
I like to have a keybinding that open the quickOpen ("workbench.action.quickOpen") and prefill the input with "task Java:", something like (not sure if it's the correct syntax for "args"):
Could be used for different purpose, like filter the list of files:
"view_*.java"
Thanks cristianhosu for looking at it.
edit: There's an example of command with arguments here
cristianhosu commentedon Jun 15, 2017
Dominique Wahli (@bizoo) - finished. Can you have a look? or maybe Benjamin Pasero (@bpasero)
Thank you
Edit: Still need to get used to working with git.
I've set my upstream and reset my master to the upstream/master and will redo the changes but now on master it throws an error while running:
chosu@CH-Acer:~/dev/GitContrib/vscode2$ npm run watch
[23:51:13] Node flags detected: --max_old_space_size=524288
[23:51:13] Respawned to PID: 4793
undefined:252
return JSON.stringify(word).replace(/[\u2028\u2029]/g, function(s) {
^
illegal access
npm ERR! Linux 4.4.0-79-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "watch"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] watch:
gulp watch --max_old_space_size=524288npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch script 'gulp watch --max_old_space_size=524288'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the code-oss-dev package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! gulp watch --max_old_space_size=524288
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs code-oss-dev
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls code-oss-dev
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/chosu/dev/GitContrib/vscode2/npm-debug.log
cristianhosu commentedon Jun 18, 2017
Hello Dominique Wahli (@bizoo)
Args usually represents an array and is treated as such.
Thus, is it acceptable for this issue to be implemented as:
In the example the args will be an array where the first item will represent the prefix.
Benjamin Pasero (@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?
microsoft#28617 - implemented according to comments in PR
bizoo commentedon Jun 19, 2017
I'm a little bit confused by how args in commands (and keybindings) works.
And as I know next to nothing of VSCode code, I couldn't help.
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 Benjamin Pasero (@bpasero) is an array of arguments (couldn't find the implementation of "type" command to compare).
So is arguments of commands and keybindings different ?
10 remaining items
bpasero commentedon Jul 7, 2017
This is now possible via:
vscode.commands.executeCommand('workbench.action.quickOpen', '>editor');bizoo commentedon Jul 10, 2017
Thanks cristianhosu and Benjamin Pasero (@bpasero).
May I ask a question ?
Why the type command have named argument and not this (and others) command ?
Doesn't change anything but just wonder why.
bpasero commentedon Jul 10, 2017
Dominique Wahli (@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.
bpasero commentedon Jul 10, 2017
Dominique Wahli (@bizoo) this actually works:
{ "key": "cmd+o", "command": "workbench.action.quickOpen", "args": "foo" }bizoo commentedon Jul 13, 2017
Benjamin Pasero (@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.
bpasero commentedon Jul 13, 2017
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.
bpasero commentedon Jul 14, 2017
Verify: you can write an extension that programmatically triggers the
workbench.action.quickOpencommand and you can pass over a string to show as prefix in the quick open picker. E.g.:Add prefix argument to Quickopen command (CTRL+P) (fixes microsoft#28617