CommonCodeStyleSettings (@NotNull Editor editor) { Project project = editor.getProject(); if (project != null) { PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); if (file != null) { return getLanguageSettings(file); } } return null; }