-
Notifications
You must be signed in to change notification settings - Fork 2.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
plugin-ext: late textmate grammar activation #7544
Conversation
212b4de
to
a0b6799
Compare
a0b6799
to
78f839a
Compare
Setup: I did a quick sanity check on this PR, using Gitpod, and the following content saved as /* > Description *********************************************************************/
/**
* sdads das asd asd asdasdasdasedasdsdas dsa asd asd sd asdasd
* as dasd sd ad sad sad asd sad sad asd asdasdasdasdasdasdsadasddas
*
*****************************************************************************/
/**
* @file asdasasdasdasdasdasd.h
* @brief
* @see
*
*****************************************************************************/
/*>a************/
#ifndef asdasdasdasdasdasd
#define asdasdasdasdasdasd
#endif There is another bug, related to the
Then I installed the latest Test: Without this fix, I only have to reload the application with editor containing |
There is a race condition when the layout is restored: if an editor was opened, it will be restored and wait for some language activation event. The issue with this was first seen with the builtin cpp extension: two cpp grammars are contributed, but the first one is not the right one to use on a cpp file. When an editor opened, the first bogus grammar is loaded and activated, triggering bogus coloration. This commit ensures that all grammars are more correctly contributed before activating anything in the next event-loop tick. Signed-off-by: Paul Maréchal <[email protected]>
78f839a
to
55a7629
Compare
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.
code-wise it makes sense, i have not tested, please make sure that it does not introduce regressions for previous changes
- use blame to identify commits
- from commits look at PRs
- run tests from
How to test
sections on such PRs
@akosyakov thanks, I tried the instructions from #6966 and did not notice any regression. |
There is a race condition when the layout is restored: if an editor was
opened, it will be restored and wait for some language activation event.
The issue with this was first seen with the builtin cpp extension: two
cpp grammars are contributed, but the first one is not the right one to
use on a cpp file. When an editor opened, the first bogus grammar is
loaded and activated, triggering bogus coloration.
This commit ensures that all grammars are more correctly contributed
before activating anything in the next event-loop tick.
Signed-off-by: Paul Maréchal [email protected]
Fixes eclipse-theia/theia-cpp-extensions#100
How to test
See eclipse-theia/theia-cpp-extensions#100, the coloration should not be bogus anymore.
Review checklist
Reminder for reviewers