-
Notifications
You must be signed in to change notification settings - Fork 30.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
[contributes.menus] how to show menu only in editor not Output window #12263
Comments
The package.json seems to correctly target only the editor:
|
@formulahendry You can use the cc @isidorn to check if we have a context key that ala |
|
We have the key |
Assigning @isidorn for the |
Hi, I use vs code 1.6 with below config but the menu still shows in output window. Any idea? "menus": {
"editor/context": [
{
"when": "!inOutput",
"command": "code-runner.run",
"group": "navigation"
}
]
} |
@formulahendry this should work as assigning simple keyboard shortcuts with the "when": "!inOutput" - works fine for me. |
I update the extension But the 'Run Code' still shows when I right-click in the Output Window area. |
Hi, any idea on this? |
@isidorn It depends with what context service you create the editor widget. It must be the same that manages the |
Sorry for the slow reply - I was working on an isolated branch. @jrieken currently I just use the scoped context key service like this So it seems that I have to make the workbench create my editor using a scoped context service which I am not sure if is possible. Can investigate but let me know if I am missing something obvious here... |
Where/How do you pass on that scoped service instance to the editor? |
Well I do not pass it currently. It is enough for the scoped service to be created on the appropriate HTML element and everything seems to work just fine for the keybindings. |
You should because otherwise those keys aren't visible (as you see with the context menu). My knowledge might be outdated after @alexandrudima last refactoring but if you create a child context and don't pass it on to the editor its key/value entries aren't visible to the editor. |
I have an extension which contributes a menu in context menu of editor. However, the menu also shows in the Output window. How could I make it only show in editor. BTW, the menu shows in Output window but not in Debug Console or Integrated Terminal. Is it bug or by design?
The text was updated successfully, but these errors were encountered: