Skip to content
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

Cannot read property 'toCustomLabel' of undefined #40

Closed
normalser opened this issue Sep 27, 2016 · 10 comments
Closed

Cannot read property 'toCustomLabel' of undefined #40

normalser opened this issue Sep 27, 2016 · 10 comments
Labels

Comments

@normalser
Copy link

  • VSCode Version: Code - Insiders 1.6.0-insider (be5e8d5, 2016-09-26T06:05:01.421Z)
  • OS Version: Darwin x64 16.0.0
  • REST Client Version: 0.8.3

Extension causes this issue:
microsoft/vscode#12709

@Huachao
Copy link
Owner

Huachao commented Sep 28, 2016

@wallverb are you using windows or macOS, since from the command you use, it seems macOS. Anyway, can you click the tab on VS Code: Help -> Toggle Developer Tools, and then you press the failed command, it will show error details in the Console in the developer tools view.

@normalser
Copy link
Author

normalser commented Sep 28, 2016

@Huachao - macOS, here is the info:

Conflict detected, command `toggleSearchRegex` cannot be triggered by alt+cmd+r due to rest-client.request
workbench.main.js:62 Conflict detected, command `toggleFindRegex` cannot be triggered by alt+cmd+r due to rest-client.request
workbench.main.js:93 Cannot read property 'toCustomLabel' of undefined: TypeError: Cannot read property 'toCustomLabel' of undefined
    at t.getLabelFor (file:////Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:92:28490)
    at Object.w [as appendKeyBindingLabel] (file:////Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:114:31225)
    at t.renderSearchInput (file:////Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:115:17546)
    at t.render (file:////Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:115:16649)
    at new t (file:////Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:115:15296)
    at t.createSearchWidget (file:////Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:115:31681)
    at t.create (file:////Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:115:28453)
    at e.<anonymous> (file:////Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:116:26052)
    at e.doElement (file:////Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:35:14008)
    at e.div (file:////Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:35:13050)

@Huachao
Copy link
Owner

Huachao commented Sep 28, 2016

@wallverb it seems the keyboard shortcut I defined for request conflicts with the command toggleSearchRegex. Does this command also use the alt+cmd+r shortcut?

@normalser
Copy link
Author

I see this in Preferences -> keybindings.json of code-insinders

{ "key": "alt+cmd+r",             "command": "toggleSearchRegex",
                                     "when": "searchInputBoxFocus && searchViewletVisible" },

but the issue happen even without pressing any shortcut

Here is the start:
image

and I will click Search icon in the left bar:

image

@Huachao
Copy link
Owner

Huachao commented Sep 28, 2016

@wallverb can you help to try to add below code in Preferences -> keybindings.json, and check it will work?

{ "key": "cmd+alt+r",            "command": "rest-client.request",
                                     "when": "editorTextFocus && editorLangId == 'http'" },
{ "key": "cmd+alt+r",            "command": "rest-client.request",
                                     "when": "editorTextFocus && editorLangId == 'plaintext'" }

@Huachao Huachao added bug and removed question labels Sep 28, 2016
@normalser
Copy link
Author

FYI:

this helps: (to cancel first that global command)

{ "key": "alt+cmd+r",            "command": "-rest-client.request"},
  { "key": "cmd+alt+r",            "command": "rest-client.request",
                                     "when": "editorTextFocus" }

@Huachao
Copy link
Owner

Huachao commented Sep 28, 2016

@wallverb I will publish a release right now and after that you can remove the hack, and sorry for the inconvenience.

@normalser
Copy link
Author

Awesome, no worries, thanks a lot

@Huachao
Copy link
Owner

Huachao commented Sep 28, 2016

@wallverb you can try the latest version 0.8.4 now, thanks 😄

@normalser
Copy link
Author

Sure, I just did - works great 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants