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

[monaco] Fix bad preference initialization #6450

Merged
merged 1 commit into from
Oct 28, 2019
Merged

[monaco] Fix bad preference initialization #6450

merged 1 commit into from
Oct 28, 2019

Conversation

svenefftinge
Copy link
Contributor

first register override identifier, because monaco will immediately
update already opened documents and then initialize with
bad preferences.

Fixes #6449

What it does

The plug-in initialization happens slightly after the editors have been created.
When a new language is registered, monaco will update the options of matching editors immediately.
But our preferenceService doesn't know yet about the override identifier and returns a bad preference model (undefined values).

This change registers the override identifier first.

How to test

  • Run Theia with built-in VS Code extensions.
  • Open an editor and make sure minimaps are disabled.
  • now reload and see if the editor has a minimap (not with this fix).

Review checklist

Reminder for reviewers

first register override identifier, because monaco will immediately
update already  opened documents and then initialize with
bad preferences.

Fixes #6449

Signed-off-by: Sven Efftinge <[email protected]>
Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

It works nicely again, thank you!

@svenefftinge svenefftinge merged commit 8814c20 into master Oct 28, 2019
@svenefftinge svenefftinge deleted the GH-6449 branch October 28, 2019 06:48
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.

[monaco] Already opened editors are initialized with default preference
2 participants