Java Code Examples for com.intellij.openapi.fileTypes.PlainSyntaxHighlighter

The following examples show how to use com.intellij.openapi.fileTypes.PlainSyntaxHighlighter. These examples are extracted from open source projects. 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
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 Project: consulo   Source File: ChunkExtractor.java    License: 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
@NotNull
@Override
public SyntaxHighlighter getHighlighter() {
    return new PlainSyntaxHighlighter();
}
 
Example 4
@Override
@NotNull
public SyntaxHighlighter getHighlighter() {
  return new PlainSyntaxHighlighter();
}
 
Example 5
@Override
@NotNull
public SyntaxHighlighter getHighlighter() {
  return new PlainSyntaxHighlighter();
}
 
Example 6
Source Project: GitToolBox   Source File: DecorationColorsPage.java    License: Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public SyntaxHighlighter getHighlighter() {
  return new PlainSyntaxHighlighter();
}
 
Example 7
@NotNull
@Override
public SyntaxHighlighter getHighlighter() {
  // We're returning blind text, so no syntax highlighting is required.
  return new PlainSyntaxHighlighter();
}
 
Example 8
Source Project: consulo   Source File: LexerEditorHighlighter.java    License: Apache License 2.0 4 votes vote down vote up
public boolean isPlain() {
  return myHighlighter instanceof PlainSyntaxHighlighter;
}
 
Example 9
Source Project: consulo   Source File: DebuggerColorsPage.java    License: Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public SyntaxHighlighter getHighlighter() {
  return new PlainSyntaxHighlighter();
}
 
Example 10
Source Project: consulo   Source File: DefaultLanguageColorsPage.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public SyntaxHighlighter getHighlighter() {
  return new PlainSyntaxHighlighter();
}
 
Example 11
Source Project: consulo   Source File: GeneralColorsPage.java    License: Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public SyntaxHighlighter getHighlighter() {
  return new PlainSyntaxHighlighter();
}
 
Example 12
Source Project: consulo   Source File: ANSIColoredConsoleColorsPage.java    License: Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public SyntaxHighlighter getHighlighter() {
   return new PlainSyntaxHighlighter();
}