FileType () { PsiElement context = getContext(); if (context != null) { PsiFile containingFile = context.getContainingFile(); if (containingFile != null) return containingFile.getFileType(); } LanguageFileType fileType = myLanguage.getAssociatedFileType(); return fileType != null ? fileType : PlainTextFileType.INSTANCE; }