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

Prevent MonacoEditorService from instantiating ContextKeyService thro… #11095

Conversation

colin-grant-work
Copy link
Contributor

@colin-grant-work colin-grant-work commented May 2, 2022

What it does

Fixes: #11096.

If we wish to override Monaco services, we must do so before the same services are instantiated by Monaco by other means. At the moment, one of our desired overrides, the MonacoEditorService is instantiating a ContextKeyService using Monaco methods, but we want to override the ContextKeyService as well. This PR changes the way the MonacoEditorService accesses the ContextKeyService to allow the override to take effect.

How to test

  1. Install this plugin
  2. Use the command palette to run the Enablement: Enable and Enablement: Disable commands.
  3. Observe that the Show Enablement Issue widget appears and disappears from its view container. (But due to viewsContainers should be hidden when empty #10778 , the view container will not close)

Review checklist

Reminder for reviewers

@colin-grant-work colin-grant-work added the monaco issues related to monaco label May 2, 2022
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirm that the changes work as expected, we can now handle setContext calls properly from plugins in order to support custom clause contexts. I also confirmed that existing when clauses work as expected causing no regressions.

package.json Show resolved Hide resolved
@colin-grant-work colin-grant-work force-pushed the bugfix/monaco-context-key-service branch from cb8b05f to 7b09850 Compare May 4, 2022 20:05
@colin-grant-work colin-grant-work merged commit 14d8cd1 into eclipse-theia:master May 4, 2022
@colin-grant-work colin-grant-work deleted the bugfix/monaco-context-key-service branch May 4, 2022 23:07
@colin-grant-work colin-grant-work added this to the 1.26.0 milestone May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
monaco issues related to monaco
Projects
None yet
Development

Successfully merging this pull request may close these issues.

view in activity area cannot be dynamically controlled via enablement
2 participants