SyntaxHighlighter (@Nullable Project project, @Nullable VirtualFile virtualFile) { if (virtualFile == null) { return PLAIN_SYNTAX_HIGHLIGHTER; } TextMateService textMateService = TextMateService.getInstance(); if (textMateService != null) { final TextMateLanguageDescriptor languageDescriptor = textMateService.getLanguageDescriptorByFileName(virtualFile.getName()); if (languageDescriptor != null) { LOG.debug("Textmate highlighting: " + virtualFile.getPath()); return new TextMateHighlighter(new TextMateHighlightingLexer(languageDescriptor, Registry.get("textmate.line.highlighting.limit").asInteger())); } } return PLAIN_SYNTAX_HIGHLIGHTER; }