WhiteSpaceFormattingStrategy (@NotNull Editor editor) { Project project = editor.getProject(); if (project != null) { PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); if (psiFile != null) { return getStrategy(psiFile.getLanguage()); } } return getStrategy(); }