-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
SearchEditor: Open new editor with args #95582
Comments
|
Note that while |
I note that there is no intellisense for the args as of
Nor is an error indicated if I omit the
|
@ArturoDent unfortunately intellisense and advanced schema validation for keybinding arguments is not supported for any commands. |
oh cool. added seems like adoption is pretty limited. other commands I tried didnt have any intellisense |
If you know of any commands that accept arguments in |
@JacksonKearl Thank you for this! I'm using this to build a "saved search" for all my TODOs, like so: {
"key": "alt+k alt+t",
"command": "search.action.openNewEditor",
"args": {
"query": "(TODO|NOTE|BUG):",
"regexp": true
},
"when": "editorTextFocus"
} Now, this launches the search editor with the input box focused and the "query" selected. I want two little improvements - perform the search automatically - don't wait for me to press Enter. And, when you've already run the search, just focus the search results for me - avoiding the need to click that area. I suppose they could implemented as other optional arguments? |
@dufferzafar that sounds like a good idea (have you tried out contextLines btw?), but could you open a separate issue? It’s much easier to manage work items as issues versus issue comments |
Yeah, I tried Issue opened: #97823 |
Sorry for the late comment before presumed release, but just today I discovered that you can do something similar with the
The args for this command are here: vscode/src/vs/workbench/contrib/search/browser/searchActions.ts Lines 163 to 172 in 9a987a1
Notice that some of the args are different and some the same as those proposed above:
I know that is in I would think that for consistency purposes they should be same where possible, especially since they both can be used in keybindings. Also note that the [I am also a little bummed that I just discovered this today thanks to https://stackoverflow.com/questions/62251045/workbench-view-search-vs-workbench-action-findinfiles-commands-in-vscode and that these commands are not reflected in intellisense (I'll open a new issue).] |
#97823 is about triggering search when running the keybinding. |
I'd like to define a keybinding to open a new search editor with args like
workbench.action.findInFiles
. The following is what I want to define:Context: I work on a project which has a lot of files and directories. "Find in Files" takes a long time so I want to limit search target under a specified directory. #95420 is similar but I want to open search editors for different directories so
"search.searchEditor.experimental.reusePriorSearchConfiguration": true
doesn't fit my cases.The text was updated successfully, but these errors were encountered: