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

Support external injections #11

Merged
merged 4 commits into from
May 23, 2016
Merged

Support external injections #11

merged 4 commits into from
May 23, 2016

Conversation

aeschli
Copy link
Contributor

@aeschli aeschli commented May 12, 2016

The pull requests adds support for external injection grammars. Injection grammars look like regular grammars, with a scope name as identifier, but have the property 'injectionSelector'.

In text mate, injection grammars are applied to all grammars. I changed that in our implementation:
We only use the injection grammars that are configured for the current language scope. The goal of this limitation is to avoid a performance regression due to many injections in the system.

The new API getInjections on the IGrammarLocator takes a language scope (e.g. 'source.js') and returns the grammar identifiers of all injection grammars to apply (e.g. [ 'text.todo', 'text.hyperlink']).
This API will be implemented on the client side (in VSCode). The idea is that each contributed injection grammar also specifies a list of grammar it applies to.

microsoft/vscode#6331 is the pull request on the VS Code side.

@alexdima alexdima merged commit 214c326 into master May 23, 2016
@alexdima
Copy link
Member

Looks good to me!

👍 that you make it explicit which grammars an injection targets.

@alexdima alexdima deleted the aeschli/external-injections branch July 12, 2019 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants