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

fix: handle grammar registrations to the same scope by different plugins #644

Merged
merged 1 commit into from
Dec 23, 2023

Conversation

sebthom
Copy link
Member

@sebthom sebthom commented Dec 23, 2023

Without this change grammar registrations from different plugins sharing the same scope name could unpredictably overwrite each other.

With this change, grammars are registered using fully qualified scope names (scopeName + '@' + pluginId). If plugin A supplies a content-type-to-scope and registers a grammar to that scope, it is ensured that if another plugin B also registers a grammar using the same scope, there won't be accidental usage of the plugin B's grammar via plugin A's content-type-to-scope binding.

The change also makes multiple grammar registrations for the same scope visible in the Preferences>TextMate>Grammars table.

image

Without this change grammar registrations from different plugins sharing
the same scope name could unpredictably overwrite each other.

With this change, grammars are registered using fully qualified scope
names (scopeName + '@' + pluginId). If plugin A supplies a
content-type-to-scope and registers a grammar to that scope, it is
ensured that if another plugin B also registers a grammar using the same
scope, there won't be accidental usage of the plugin B's grammar via
plugin A's content-type-to-scope binding.

The change also makes multiple grammar registrations for the same scope
visible in the Preferences>TextMate>Grammars table.
@github-actions github-actions bot added the bug label Dec 23, 2023
@sebthom sebthom merged commit 4199ad9 into eclipse:main Dec 23, 2023
6 checks passed
@sebthom sebthom deleted the conflicting-grammar-registrations branch December 23, 2023 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant