-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle grammar registrations to the same scope by different plugins
Without this change grammar registrations from different plugins sharing the same scope name could unpredictably overwrite each other. With this change, grammars are registered using fully qualified scope names (scopeName + '@' + pluginId). If plugin A supplies a content-type-to-scope and registers a grammar to that scope, it is ensured that if another plugin B also registers a grammar using the same scope, there won't be accidental usage of the plugin B's grammar via plugin A's content-type-to-scope binding. The change also makes multiple grammar registrations for the same scope visible in the Preferences>TextMate>Grammars table.
- Loading branch information
Showing
14 changed files
with
303 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Local work folder that is not checked in | ||
_LOCAL/ | ||
|
||
# Eclipse | ||
/bin | ||
/*/bin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
org.eclipse.tm4e.registry/src/main/java/org/eclipse/tm4e/registry/ITMScope.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Copyright (c) 2023 Sebastian Thomschke and others. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* - Sebastian Thomschke - initial API and implementation | ||
*/ | ||
package org.eclipse.tm4e.registry; | ||
|
||
import org.eclipse.jdt.annotation.Nullable; | ||
|
||
/** | ||
* TextMate grammar scope API | ||
*/ | ||
public interface ITMScope { | ||
|
||
String getName(); | ||
|
||
String getQualifiedName(); | ||
|
||
@Nullable | ||
String getPluginId(); | ||
|
||
boolean isQualified(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.