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

ITokenizationRegistry to support TokenizationSupport promises #58703

Merged
merged 2 commits into from
Sep 17, 2018

Conversation

aeschli
Copy link
Contributor

@aeschli aeschli commented Sep 14, 2018

fixes #53723

With the latest TextMate changes, grammars are now created asynchronously (due to the async loading of the grammar files and async creation of the textmate engine).

In VSCode, TMSyntax listens on modeService.onDidCreateMode, then creates the tokenization support and registers it with the TokenizationRegistry.
Before that happened in sync. Users (such as the markdownRenderer for the hover) could trigger a mode creation and after that directly access the TokenizationRegistry for the tokenizationSupport.
Now the tokenizationSupport is created asynchronously.

Here's a pragmatic fix where the TokenizationRegistry can return a promise of a tokenizationSupport, and syntax providers can register a tokenizationSupport promise.

The existing sync access (and reacting to change events) is also still supported.

@alexandrudima Let me know if that change is ok for you. I tried to not boil the ocean, but the whole area could need some refactorings, such as decoupling of the initialization of the TokenizationRegistry from the mode service.

@aeschli aeschli self-assigned this Sep 14, 2018
@aeschli aeschli added this to the September 2018 milestone Sep 14, 2018
@aeschli aeschli requested review from jrieken and removed request for jrieken September 14, 2018 16:01
Copy link
Member

@alexdima alexdima left a comment

Choose a reason for hiding this comment

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

👍 Just please remove the unused ITokenizationService.

@aeschli aeschli merged commit f22940a into master Sep 17, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
@aeschli aeschli deleted the aeschli/tokenizersupport-initialization branch June 29, 2020 13:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

First hover is no longer syntax-highlighted since 1.25
2 participants