-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
How can I customize context menu? I want to delete 'Go to definition' and others,and add my own meun. #1280
Comments
We don't offer API to accomplish this. You could reach into the menu registrations and remove them |
searching "monaco editor customize context menu" brought me here. I'm aware this is not the right place, but can you share how you added "Add comment"? kindly share us some code :) Thanks! |
The example is good. Is there a way to display which group are used in the context menu? From the doc:
Is there a way to find the other context menu group such as the command palette group? |
Since #1567 is locked, and this took me absolute AGES to figure out, I wanted to share the latest workaround for removing unwanted context menu items. I didn't like the CSS hack, it seemed too fragile and I didn't know what other effects disabling the shadow DOM might have. But none of the previous hacks worked. Instead I found a solution involving monkey-patching the internals of the context menu, as suggested here:
Unfortunately it does run on every click of the context menu, but c'est la vie... hope this helps someone else. |
I have use addAction add 'add Commont', and I don't want others.How can I do?
The text was updated successfully, but these errors were encountered: