Skip to content

Commit b83ef7c

Browse files
committed
fix: register injections with fully qualified scope names
1 parent 5ea7761 commit b83ef7c

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

org.eclipse.tm4e.registry/src/main/java/org/eclipse/tm4e/registry/IGrammarRegistryManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ default IGrammarRegistryManager.EditSession newEditSession() {
100100
/**
101101
* @param scopeName an unqualified (sources.batchfile) or qualified (sources.batchfile@plugin) scope name
102102
*
103-
* @return list of scope names to inject for the given <code>scopeName</code> and null otherwise.
103+
* @return list of registered scope names to inject for the given <code>scopeName</code> and null otherwise.
104104
*/
105105
@Nullable
106106
Collection<String> getInjections(String scopeName);
107107

108108
/**
109-
* @return list of scope names to inject for the given scope name and null otherwise.
109+
* @return list of registered scope names to inject for the given scope name and null otherwise.
110110
*/
111111
@Nullable
112112
Collection<String> getInjections(ITMScope scope);

org.eclipse.tm4e.registry/src/main/java/org/eclipse/tm4e/registry/internal/AbstractGrammarRegistryManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,14 @@ public IGrammarDefinition[] getDefinitions() {
264264
/**
265265
* Register the given <code>scopeName</code> to inject to the given scope name <code>injectTo</code>.
266266
*/
267-
protected void registerInjection(final String scopeName, final String injectTo) {
267+
void registerInjection(final TMScope scopeName, final String injectTo) {
268268
// -> used by GrammarRegistryManager.loadGrammarsFromExtensionPoints()
269269
Collection<String> injectionsOfScope = getInjections(injectTo);
270270
if (injectionsOfScope == null) {
271271
injectionsOfScope = new ArrayList<>();
272272
injections.put(injectTo, injectionsOfScope);
273273
}
274-
injectionsOfScope.add(scopeName);
274+
injectionsOfScope.add(scopeName.toString());
275275
}
276276

277277
@Override

org.eclipse.tm4e.registry/src/main/java/org/eclipse/tm4e/registry/internal/GrammarRegistryManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ private void loadGrammarsFromExtensionPoints() {
6161
registerGrammarDefinition(new GrammarDefinition(ce));
6262
break;
6363
case XMLConstants.INJECTION_ELT: {
64-
final String scopeName = ce.getAttribute(XMLConstants.SCOPE_NAME_ATTR);
64+
final var scope = new TMScope(ce.getAttribute(XMLConstants.SCOPE_NAME_ATTR), ce.getNamespaceIdentifier());
6565
final String injectTo = ce.getAttribute(XMLConstants.INJECT_TO_ATTR);
66-
registerInjection(scopeName, injectTo);
66+
registerInjection(scope, injectTo);
6767
break;
6868
}
6969
case XMLConstants.SCOPE_NAME_CONTENT_TYPE_BINDING_ELT: {

0 commit comments

Comments
 (0)