void (@NotNull EditorEx editor) { boolean apply = isEnabled(); if (!READY) { return; } Project project = editor.getProject(); if (project == null) { return; } PsiFile file = ReadAction.compute(() -> PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument())); if (file == null) { return; } Function<? super InspectionProfile, ? extends InspectionProfileWrapper> strategy = InspectionProfileWrapper.getCustomInspectionProfileWrapper(file); if (strategy == null) { strategy = new MyInspectionProfileStrategy(); InspectionProfileWrapper.setCustomInspectionProfileWrapperTemporarily(file, strategy); } if (!(strategy instanceof MyInspectionProfileStrategy)) { return; } ((MyInspectionProfileStrategy)strategy).setUseSpellCheck(apply); if (apply) { editor.putUserData(IntentionManager.SHOW_INTENTION_OPTIONS_KEY, false); } // Update representation. DaemonCodeAnalyzer analyzer = DaemonCodeAnalyzer.getInstance(project); if (analyzer != null) { analyzer.restart(file); } }