mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inspections:
1. add @NotNull scope parameter of ToolsImpl#enableTool() and replace callers respectively 2. InspectionProfileImpl#enableTool() always enables default tool
This commit is contained in:
+1
-1
@@ -129,7 +129,7 @@ public class InspectionProfileConvertor {
|
||||
|
||||
//set up tools for default profile
|
||||
if (level != HighlightDisplayLevel.DO_NOT_SHOW) {
|
||||
profile.enableTool(shortName, null, null);
|
||||
profile.enableTool(shortName, null);
|
||||
}
|
||||
|
||||
if (level == null || level == HighlightDisplayLevel.DO_NOT_SHOW) {
|
||||
|
||||
+2
-4
@@ -660,13 +660,11 @@ public class InspectionProfileImpl extends NewInspectionProfile {
|
||||
public void enableTool(@NotNull String toolId, Project project) {
|
||||
final ToolsImpl tools = getTools(toolId, project);
|
||||
tools.setEnabled(true);
|
||||
if (tools.getNonDefaultTools() == null) {
|
||||
tools.getDefaultState().setEnabled(true);
|
||||
}
|
||||
tools.getDefaultState().setEnabled(true);
|
||||
schemeState = SchemeState.POSSIBLY_CHANGED;
|
||||
}
|
||||
|
||||
public void enableTool(@NotNull String inspectionTool, NamedScope namedScope, Project project) {
|
||||
public void enableTool(@NotNull String inspectionTool, @NotNull NamedScope namedScope, Project project) {
|
||||
getTools(inspectionTool, project).enableTool(namedScope, project);
|
||||
schemeState = SchemeState.POSSIBLY_CHANGED;
|
||||
}
|
||||
|
||||
@@ -394,10 +394,10 @@ public class ToolsImpl implements Tools {
|
||||
myEnabled = enabled;
|
||||
}
|
||||
|
||||
public void enableTool(NamedScope namedScope, Project project) {
|
||||
public void enableTool(@NotNull NamedScope namedScope, Project project) {
|
||||
if (myTools != null) {
|
||||
for (ScopeToolState state : myTools) {
|
||||
if (Comparing.equal(state.getScope(project), namedScope)) {
|
||||
if (namedScope.equals(state.getScope(project))) {
|
||||
state.setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-7
@@ -234,13 +234,7 @@ public class PyCompatibilityInspectionAdvertiser implements Annotator {
|
||||
final InspectionProfileImpl profile = InspectionProjectProfileManager.getInstance(project).getCurrentProfile();
|
||||
final InspectionToolWrapper tool = profile.getInspectionTool(getCompatibilityInspectionShortName(), project);
|
||||
if (tool != null) {
|
||||
// Partially copied from JSLinterInspection
|
||||
final InspectionProfileImpl inspectionProfileImpl = as(profile, InspectionProfileImpl.class);
|
||||
if (inspectionProfileImpl != null) {
|
||||
final ScopeToolState state = inspectionProfileImpl.getToolDefaultState(tool.getShortName(), project);
|
||||
state.setEnabled(true);
|
||||
}
|
||||
profile.modifyProfile(model -> model.enableTool(tool.getShortName(), null, project));
|
||||
profile.modifyProfile(model -> model.enableTool(tool.getShortName(), project));
|
||||
EditInspectionToolsSettingsAction.editToolSettings(project, profile, getCompatibilityInspectionShortName());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user