Skip to content

Support external injections#11

Merged
alexdima merged 4 commits intomasterfrom
aeschli/external-injections
May 23, 2016
Merged

Support external injections#11
alexdima merged 4 commits intomasterfrom
aeschli/external-injections

Conversation

@aeschli
Copy link
Copy Markdown
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
Copy Markdown
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.

2 participants