mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
restore compatibility
This commit is contained in:
@@ -17,6 +17,7 @@ package com.intellij.openapi.fileTypes;
|
||||
|
||||
import com.intellij.lexer.Lexer;
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey;
|
||||
import com.intellij.openapi.util.NotNullLazyValue;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -27,6 +28,13 @@ import org.jetbrains.annotations.NotNull;
|
||||
* @see com.intellij.openapi.fileTypes.SyntaxHighlighterFactory#getSyntaxHighlighter(com.intellij.lang.Language, com.intellij.openapi.project.Project, com.intellij.openapi.vfs.VirtualFile)
|
||||
*/
|
||||
public interface SyntaxHighlighter {
|
||||
/**
|
||||
* @deprecated
|
||||
* @see com.intellij.openapi.fileTypes.SyntaxHighlighterFactory#getSyntaxHighlighter(com.intellij.openapi.project.Project, com.intellij.openapi.vfs.VirtualFile)
|
||||
* @see com.intellij.openapi.fileTypes.SyntaxHighlighterFactory#getSyntaxHighlighter(com.intellij.lang.Language, com.intellij.openapi.project.Project, com.intellij.openapi.vfs.VirtualFile)
|
||||
*/
|
||||
@Deprecated SyntaxHighlighterProvider PROVIDER = new FileTypeExtensionFactory<SyntaxHighlighterProvider>(SyntaxHighlighterProvider.class, "com.intellij.syntaxHighlighter").get();
|
||||
|
||||
/**
|
||||
* Returns the lexer used for highlighting the file. The lexer is invoked incrementally when the file is changed, so it must be
|
||||
* capable of saving/restoring state and resuming lexing from the middle of the file.
|
||||
|
||||
+1
-8
@@ -28,13 +28,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public abstract class SyntaxHighlighterFactory {
|
||||
public static final SyntaxHighlighterLanguageFactory LANGUAGE_FACTORY = new SyntaxHighlighterLanguageFactory();
|
||||
private static final NotNullLazyValue<SyntaxHighlighterProvider> PROVIDER = new NotNullLazyValue<SyntaxHighlighterProvider>() {
|
||||
@NotNull
|
||||
@Override
|
||||
protected SyntaxHighlighterProvider compute() {
|
||||
return new FileTypeExtensionFactory<SyntaxHighlighterProvider>(SyntaxHighlighterProvider.class, "com.intellij.syntaxHighlighter").get();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns syntax highlighter for the given language.
|
||||
@@ -58,7 +51,7 @@ public abstract class SyntaxHighlighterFactory {
|
||||
*/
|
||||
@Nullable
|
||||
public static SyntaxHighlighter getSyntaxHighlighter(final FileType fileType, final @Nullable Project project, final @Nullable VirtualFile virtualFile) {
|
||||
return PROVIDER.getValue().create(fileType, project, virtualFile);
|
||||
return SyntaxHighlighter.PROVIDER.create(fileType, project, virtualFile);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user