void (@NotNull Project project, @NotNull InspectionProfileImpl profile, @NotNull Language fileLanguage) { // instantiate all tools to avoid extension loading in inconvenient moment profile.getAllEnabledInspectionTools(project).forEach(state -> { InspectionToolWrapper<?, ?> wrapper = state.getTool(); String inspectionLanguage = wrapper.getLanguage(); if (inspectionLanguage == null || fileLanguage.isKindOf(inspectionLanguage)) { wrapper.getTool(); } }); ProjectInspectionProfileManager manager = (ProjectInspectionProfileManager)InspectionProjectProfileManager.getInstance(project); manager.addProfile(profile); InspectionProfileImpl prev = manager.getCurrentProfile(); manager.setCurrentProfile(profile); Disposer.register(((ProjectEx)project).getEarlyDisposable(), () -> { InspectionProfileImpl.INIT_INSPECTIONS = false; manager.setCurrentProfile(prev); manager.deleteProfile(profile); }); }