Tokenizer (PsiElement element) { if (element instanceof PsiWhiteSpace) { return EMPTY_TOKENIZER; } if (isInjectedLanguageFragment(element)) { return EMPTY_TOKENIZER; } if (element instanceof PsiNameIdentifierOwner) return PsiIdentifierOwnerTokenizer.INSTANCE; if (element instanceof PsiComment) { if (SuppressionUtil.isSuppressionComment(element)) { return EMPTY_TOKENIZER; } //don't check shebang if (element.getTextOffset() == 0 && element.getText().startsWith("#!")) { return EMPTY_TOKENIZER; } return myCommentTokenizer; } if (element instanceof PsiPlainText) { PsiFile file = element.getContainingFile(); FileType fileType = file == null ? null : file.getFileType(); if (fileType instanceof CustomSyntaxTableFileType) { return new CustomFileTypeTokenizer(((CustomSyntaxTableFileType)fileType).getSyntaxTable()); } return TEXT_TOKENIZER; } return EMPTY_TOKENIZER; }