com.intellij.openapi.fileTypes.PlainSyntaxHighlighter Java Examples

The following examples show how to use com.intellij.openapi.fileTypes.PlainSyntaxHighlighter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SyntaxHighlighterOverEditorHighlighter.java    From consulo with Apache License 2.0 6 votes vote down vote up
public SyntaxHighlighterOverEditorHighlighter(SyntaxHighlighter _highlighter, VirtualFile file, Project project) {
  if (file.getFileType() == PlainTextFileType.INSTANCE) { // optimization for large files, PlainTextSyntaxHighlighterFactory is slow
    highlighter = new PlainSyntaxHighlighter();
    lexer = highlighter.getHighlightingLexer();
  } else {
    highlighter = _highlighter;
    LayeredLexer.ourDisableLayersFlag.set(Boolean.TRUE);
    EditorHighlighter editorHighlighter = EditorHighlighterFactory.getInstance().createEditorHighlighter(project, file);

    try {
      if (editorHighlighter instanceof LayeredLexerEditorHighlighter) {
        lexer = new LexerEditorHighlighterLexer(editorHighlighter, false);
      }
      else {
        lexer = highlighter.getHighlightingLexer();
      }
    }
    finally {
      LayeredLexer.ourDisableLayersFlag.set(null);
    }
  }
}
 
Example #2
Source File: ChunkExtractor.java    From consulo with Apache License 2.0 5 votes vote down vote up
private ChunkExtractor(@Nonnull PsiFile file) {
  myColorsScheme = UsageTreeColorsScheme.getInstance().getScheme();

  Project project = file.getProject();
  myDocument = PsiDocumentManager.getInstance(project).getDocument(file);
  LOG.assertTrue(myDocument != null);
  final FileType fileType = file.getFileType();
  SyntaxHighlighter highlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(fileType, project, file.getVirtualFile());
  highlighter = highlighter == null ? new PlainSyntaxHighlighter() : highlighter;
  myHighlighter = new SyntaxHighlighterOverEditorHighlighter(highlighter, file.getVirtualFile(), project);
  myDocumentStamp = -1;
}
 
Example #3
Source File: HighlightBracketPairSettingsPage.java    From HighlightBracketPair with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public SyntaxHighlighter getHighlighter() {
    return new PlainSyntaxHighlighter();
}
 
Example #4
Source File: FlutterLogColorPage.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
@NotNull
public SyntaxHighlighter getHighlighter() {
  return new PlainSyntaxHighlighter();
}
 
Example #5
Source File: FlutterLogColorPage.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
@NotNull
public SyntaxHighlighter getHighlighter() {
  return new PlainSyntaxHighlighter();
}
 
Example #6
Source File: DecorationColorsPage.java    From GitToolBox with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public SyntaxHighlighter getHighlighter() {
  return new PlainSyntaxHighlighter();
}
 
Example #7
Source File: LocalSarosAnnotationColorsPage.java    From saros with GNU General Public License v2.0 4 votes vote down vote up
@NotNull
@Override
public SyntaxHighlighter getHighlighter() {
  // We're returning blind text, so no syntax highlighting is required.
  return new PlainSyntaxHighlighter();
}
 
Example #8
Source File: LexerEditorHighlighter.java    From consulo with Apache License 2.0 4 votes vote down vote up
public boolean isPlain() {
  return myHighlighter instanceof PlainSyntaxHighlighter;
}
 
Example #9
Source File: DebuggerColorsPage.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public SyntaxHighlighter getHighlighter() {
  return new PlainSyntaxHighlighter();
}
 
Example #10
Source File: DefaultLanguageColorsPage.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public SyntaxHighlighter getHighlighter() {
  return new PlainSyntaxHighlighter();
}
 
Example #11
Source File: GeneralColorsPage.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public SyntaxHighlighter getHighlighter() {
  return new PlainSyntaxHighlighter();
}
 
Example #12
Source File: ANSIColoredConsoleColorsPage.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public SyntaxHighlighter getHighlighter() {
   return new PlainSyntaxHighlighter();
}