-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Moved theme Map and added API to use it from other dependencies #12861
Conversation
Thanks for making a pull request to jupyterlab! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using tokens is nice. But this requires changing a bit the current structure to not use static object. In particular the editorThemeRegistry
. They should be propagated to the EditorConfiguration
. Or the logic should be similar to the EditorModeRegistry
that modifies a static list.
Otherwise, providing a different theme registry overriding the token will not have the expected outcome.
If we want to align more with other APIs, the generic pattern are:
- tokens that define registries
- registries provide factories
- factories instantiate objects
But that would require more work for the code editor.
@fcollonval I removed the token API for now, so we don't have backward incompatible changes when we add it later, and I added an API for getting and adding themes similar to that of Mode.
Not sure to understand why this would work. The My understanding is that we would also need to propagate the mode registry object to the editor configuration object to get the expected behavior. But that can be done after 4.0. |
I'm taking over this PR. I added a test for adding a mode (not yet pushed) |
bot please update snapshots |
Use codemirror theme example to test theme registration
bot please update snapshots |
bot please update snapshots |
bot please update galata snapshots |
Kicking the CI |
This fixes some issues reported in #12812:
This also adds a token for modes and themes registry.
This PR is not finished but a review would be appreciated to know if it goes in the right direction. If so I would add missing doc strings and redirection.
I also wonder if we should expose more methods from Mode via the IEditorModeRegistry interface.