From bdeb68cfaef6bc8bf309551ebe6545b40f2c7e9b Mon Sep 17 00:00:00 2001 From: sebthom Date: Wed, 13 Mar 2024 18:55:04 +0100 Subject: [PATCH] fix: registering local grammar injection in plugin.xml broken #733 --- .../internal/AbstractGrammarRegistryManager.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/org.eclipse.tm4e.registry/src/main/java/org/eclipse/tm4e/registry/internal/AbstractGrammarRegistryManager.java b/org.eclipse.tm4e.registry/src/main/java/org/eclipse/tm4e/registry/internal/AbstractGrammarRegistryManager.java index c7ab7de8a..936e1d2be 100644 --- a/org.eclipse.tm4e.registry/src/main/java/org/eclipse/tm4e/registry/internal/AbstractGrammarRegistryManager.java +++ b/org.eclipse.tm4e.registry/src/main/java/org/eclipse/tm4e/registry/internal/AbstractGrammarRegistryManager.java @@ -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 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()); } /** @@ -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)); }