Lexer (@NotNull PsiFile file) { if (!(file instanceof MarkdownFile)) { return null; } try { LayeredLexer.ourDisableLayersFlag.set(Boolean.TRUE); return ((MarkdownFile)file).getParserDefinition().createLexer(file.getProject()); } finally { LayeredLexer.ourDisableLayersFlag.set(null); } }