// Path: src/main/java/org/antlr/jetbrains/st4plugin/STGroupFileType.java
// public class STGroupFileType extends LanguageFileType implements TemplateLanguageFileType {
//     public static final STGroupFileType INSTANCE = new STGroupFileType();
// 
//     protected STGroupFileType() {
//         super(STGroupLanguage.INSTANCE);
//     }
// 
//     @NotNull
//     @Override
//     public String getName() {
//         return "StringTemplate v4 template group file";
//     }
// 
//     @NotNull
//     @Override
//     public String getDescription() {
//         return "StringTemplate v4 template group file";
//     }
// 
//     @NotNull
//     @Override
//     public String getDefaultExtension() {
//         return "stg";
//     }
// 
//     @Nullable
//     @Override
//     public Icon getIcon() {
//         return Icons.STG_FILE;
//     }
// 
//     static class Factory extends FileTypeFactory {
//         @Override
//         public void createFileTypes(@NotNull FileTypeConsumer consumer) {
//             consumer.consume(STGroupFileType.INSTANCE);
//         }
//     }
// }
// 
// Path: src/main/java/org/antlr/jetbrains/st4plugin/psi/STTokenTypes.java
// public static TokenIElementType getTokenElementType(@MagicConstant(valuesFromClass = STLexer.class) int ruleIndex) {
//     return TOKEN_ELEMENT_TYPES.get(ruleIndex);
// }


import com.intellij.lang.Language;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.ex.util.LayerDescriptor;
import com.intellij.openapi.editor.ex.util.LayeredLexerEditorHighlighter;
import com.intellij.openapi.editor.highlighter.EditorHighlighter;
import com.intellij.openapi.fileTypes.EditorHighlighterProvider;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.SyntaxHighlighter;
import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.templateLanguages.TemplateDataLanguageMappings;
import org.antlr.jetbrains.st4plugin.STGroupFileType;
import org.antlr.jetbrains.st4plugin.parsing.STLexer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static org.antlr.jetbrains.st4plugin.psi.STTokenTypes.getTokenElementType;
package org.antlr.jetbrains.st4plugin.highlight;



public class STEditorHighlighterProvider implements EditorHighlighterProvider {

    @Override
    public EditorHighlighter getEditorHighlighter(@Nullable Project project, @NotNull FileType fileType, @Nullable VirtualFile virtualFile, @NotNull EditorColorsScheme colors) {
        return new STEditorHighlighter(virtualFile, project, fileType, colors);
    }
}

/**
 * Highlights the "outer language", i.e. the target language.
 * The target language can be configured in the Template Data Languages settings.
 */
class STEditorHighlighter extends LayeredLexerEditorHighlighter {

    public STEditorHighlighter(@Nullable VirtualFile virtualFile,
// Path: src/main/java/org/antlr/jetbrains/st4plugin/STGroupFileType.java
// public class STGroupFileType extends LanguageFileType implements TemplateLanguageFileType {
//     public static final STGroupFileType INSTANCE = new STGroupFileType();
// 
//     protected STGroupFileType() {
//         super(STGroupLanguage.INSTANCE);
//     }
// 
//     @NotNull
//     @Override
//     public String getName() {
//         return "StringTemplate v4 template group file";
//     }
// 
//     @NotNull
//     @Override
//     public String getDescription() {
//         return "StringTemplate v4 template group file";
//     }
// 
//     @NotNull
//     @Override
//     public String getDefaultExtension() {
//         return "stg";
//     }
// 
//     @Nullable
//     @Override
//     public Icon getIcon() {
//         return Icons.STG_FILE;
//     }
// 
//     static class Factory extends FileTypeFactory {
//         @Override
//         public void createFileTypes(@NotNull FileTypeConsumer consumer) {
//             consumer.consume(STGroupFileType.INSTANCE);
//         }
//     }
// }
// 
// Path: src/main/java/org/antlr/jetbrains/st4plugin/psi/STTokenTypes.java
// public static TokenIElementType getTokenElementType(@MagicConstant(valuesFromClass = STLexer.class) int ruleIndex) {
//     return TOKEN_ELEMENT_TYPES.get(ruleIndex);
// }


// Path: src/main/java/org/antlr/jetbrains/st4plugin/highlight/STEditorHighlighterProvider.java
import com.intellij.lang.Language;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.ex.util.LayerDescriptor;
import com.intellij.openapi.editor.ex.util.LayeredLexerEditorHighlighter;
import com.intellij.openapi.editor.highlighter.EditorHighlighter;
import com.intellij.openapi.fileTypes.EditorHighlighterProvider;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.SyntaxHighlighter;
import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.templateLanguages.TemplateDataLanguageMappings;
import org.antlr.jetbrains.st4plugin.STGroupFileType;
import org.antlr.jetbrains.st4plugin.parsing.STLexer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static org.antlr.jetbrains.st4plugin.psi.STTokenTypes.getTokenElementType;

package org.antlr.jetbrains.st4plugin.highlight;



public class STEditorHighlighterProvider implements EditorHighlighterProvider {

    @Override
    public EditorHighlighter getEditorHighlighter(@Nullable Project project, @NotNull FileType fileType, @Nullable VirtualFile virtualFile, @NotNull EditorColorsScheme colors) {
        return new STEditorHighlighter(virtualFile, project, fileType, colors);
    }
}

/**
 * Highlights the "outer language", i.e. the target language.
 * The target language can be configured in the Template Data Languages settings.
 */
class STEditorHighlighter extends LayeredLexerEditorHighlighter {

    public STEditorHighlighter(@Nullable VirtualFile virtualFile,
                               @Nullable Project project,