Skip to content

Commit

Permalink
fix: registering local grammar injection in plugin.xml broken #733
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Mar 13, 2024
1 parent 997ca82 commit bdeb68c
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,14 @@ public Reader getReader() throws IOException {
.toArray(IGrammarDefinition[]::new);
}


/**
* @param scopeName an unqualified (sources.batchfile) or qualified (sources.batchfile@plugin) scope name
*/
@Override
public @Nullable Collection<String> getInjections(final String scopeName) {
// -> is effectively unused at the moment
return injections.get(scopeName);
// -> indirectly used by org.eclipse.tm4e.core.registry.Registry._doLoadSingleGrammar(String)
return injections.get(TMScope.parse(scopeName).getName());
}

/**
Expand All @@ -283,7 +287,7 @@ void registerInjection(final String scopeName, final String injectTo) {
.map(binding -> binding.contentType).toList();
}

void registerContentTypeToScopeBinding(String pluginId, IContentType contentType, String scopeName) {
void registerContentTypeToScopeBinding(final String pluginId, final IContentType contentType, final String scopeName) {
// -> used by GrammarRegistryManager.loadGrammarsFromExtensionPoints()
contentTypeToScopeBindings.put(contentType, new ContentTypeToScopeBinding(pluginId, contentType, scopeName));
}
Expand Down

0 comments on commit bdeb68c

Please sign in to comment.