This behavior started happening after upgrading to VSCode 1.6.0 today.
Steps to Reproduce:
The search pane is empty. No search fields (see screenshot)

Launch Visual Studio Code
cmd+shift+f to trigger the workbench.view.search commandAn error occurs (see screenshot)

Launch Visual Studio Code
cmd+shift+f to trigger the workbench.view.search commandAn error occurs (see screenshot)

Launch Visual Studio Code
cmd+b to trigger the workbench.action.toggleSidebarVisibility command
Here are the error messages in the devtools console....

btw... these errors happen even with the --disable-extensions argument, so they don't appear to be caused by an extension
Does code --force-gpu-rasterization help any?
Just ran into this myself with 1.6. With --force-gpu-rasterization I get:
Cannot read property 'toCustomLabel' of undefined
@chrmarti - I tried code --force-gpu-rasterization and code --force-gpu-rasterization --disable-extensions. Neither one fixed the problem :(
Possibly related to #12709
I at least do not have the REST Client extension installed, and --disable-extensions doesn't fix the issue.
@TimMensch Which OS and OS version are you running?
Windows 10/x64, version 1.6.0, 2016-10-10T18:37:40
Sorry, OS version: Windows 10 Pro, 1511, 10586.589
@chrmarti I've got another Windows 10 system, but I've not let VS Code update on it for fear of losing search on both.
I uninstalled all of my extensions, just to see if that helped, but no luck.
Could you append your keybindings.json? There appears to be a bug with the new commands in the Search viewlet. @sandy081
I'm not modifying the "Find" key:
[
{ "key": "ctrl+]", "command": "editor.action.jumpToBracket", "when": "editorTextFocus" },
{ "key": "ctrl+alt+b", "command": "editor.action.format","when": "editorTextFocus" },
{ "key": "ctrl+w", "command": "workbench.action.closeActiveEditor" },
{ "key": "alt+w","command": "expand_region" },
{ "key": "alt+left", "command": "workbench.action.focusPreviousGroup" },
{ "key": "alt+right", "command": "workbench.action.focusNextGroup" },
{ "key": "ctrl+'", "command": "esQuotes.transformBetweenSingleDoubleQuotes" },
{ "key": "ctrl+alt+left", "command": "workbench.action.focusPreviousGroup" },
{ "key": "ctrl+alt+right", "command": "workbench.action.focusNextGroup" },
{ "key": "ctrl+shift+'", "command": "esQuotes.transformToTemplateString" },
{ "key": "ctrl+alt+d ctrl+alt+t", "command":"docthis.traceTypeScriptSyntaxNode"}
]
@chrmarti For fun I deleted my keybindings and it still comes up with the same error, and selecting View: Show Search from the command palette _also_ brings up the same error.
@chrmarti - Yep. I was just about to post that.
I completely uninstalled VSCode and deleted my ~/Library/Application Support/Code folder. Then I reinstalled VSCode, and the errors were gone. 👍
Then I restored my custom keybindings and restarted VSCode, and the errors were back. 👎
So I started removing custom keybindings one-by-one and restarting VSCode after each one until I found the culprit. Here is the keybinding that's causing the error (for me, anyway)...
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "alt+cmd+w",
"command": "workbench.action.closeAllEditors"
}
]
@BigstickCarpet @chrmarti Sure enough, success:
{ "key": "alt+w","command": "expand_region" },
This was the culprit for me. It didn't fix things to just delete it; I had to restart VS Code between tests.
A workaround would be to make sure the following commands are bound to at least one (arbitrary) key combination:
"toggleSearchCaseSensitive""toggleSearchWholeWord""toggleSearchRegex"And, as you mentioned, a restart is necessary to make it work.
Awesome sleuthing. 🕵️ This also works for me:
{ "key": "alt+w","command": "expand_region", "when":"editorFocus" },
I added a "when" clause to my keybinding so it wouldn't _kill_ the other binding, just hide it when the editor is active.
/cc @isidorn
Problem for me was also a custom keybinding:
{
"key": "cmd+alt+r",
"command": "workbench.action.focusSideBar"
},
Presumably because it overwrites the default for toggleFindRegex and thus invalidates the requirements specified by @chrmarti :
{ "key": "alt+cmd+r", "command": "toggleFindRegex",
"when": "editorFocus" },
To me it only happens when assigns to cmd+alt+r, for instance:
left menu empty
{
"key": "cmd+alt+r",
"command": "editor.action.format"
}
left menu ok
{
"key": "cmd+r",
"command": "editor.action.format"
}
@eduardonunesp On Mac, cmd+alt+r is the short cut for enabling reg-ex toggleSearchCaseSensitive in Search view which is taken by editor.action.format. I have fix in ready and is already available in Insiders. Temporary workaround is to assign a different shortcut for toggleSearchCaseSensitive.
Thanks
Problem for me was due to:
{ "key": "alt+cmd+c", "command": "workbench.files.action.collapseFilesExplorerFolders" }
Same here on MacOS El Capitan
my keybindings.json was
[
{ "key": "shift+cmd+7", "command": "editor.action.commentLine"},
{ "key": "alt+`", "command": "workbench.action.navigateBack" },
{ "key": "shift+alt+`", "command": "workbench.action.navigateForward" },
{ "key": "cmd+alt+c", "command": "workbench.action.git.input-commit" },
{ "key": "cmd+alt+p", "command": "workbench.action.git.push" },
{ "key": "cmd+m", "command": "editor.action.jumpToBracket"}
]
After delete the custom keybindings and restart, everything works fine.
@d4v1dst Sorry for that. This is because of the key-binding cmd+alt+c.
Verification:
Customize following default key bindings to other actions
Mac
Windows/Linux
Verify that Search view is opening without any errors
For me, these custom keybindings were the issue, after removing them, the search view worked:
{ "key": "shift+alt+c", "command": "toggleFindCaseSensitive", "when": "editorFocus" },
{ "key": "shift+alt+w", "command": "toggleFindWholeWord", "when": "editorFocus" },
Also, I need to mention that I have another custom key bound to alt+c, that before the update of vs code to 1.6.0, was a free key:
{ "key": "alt+c", "command": "vstortoise.svnCommit" },
@lypscan alt+c was always taken to toggle case sensitive option in Editor find widget. With your customization, this key binding was overridden
@sandy081 yes, now I remember... In any case, the error seems to manifest itself whenever I override the default keybindings for: toggleFindCaseSensitive, toggleFindWholeWord, toggleFindRegex.
Most helpful comment
A workaround would be to make sure the following commands are bound to at least one (arbitrary) key combination:
"toggleSearchCaseSensitive""toggleSearchWholeWord""toggleSearchRegex"And, as you mentioned, a restart is necessary to make it work.