Skip to content

Commit 5680c65

Browse files
committed
Enable optimize imports on the fly by default
1 parent 2a5b76b commit 5680c65

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

src/com/goide/codeInsight/imports/GoCodeInsightSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
)
2727
public class GoCodeInsightSettings implements PersistentStateComponent<GoCodeInsightSettings> {
2828
private boolean myShowImportPopup = true;
29-
private boolean myOptimizeImportsOnTheFly = false;
29+
private boolean myOptimizeImportsOnTheFly = true;
3030
private boolean myAddUnambiguousImportsOnTheFly = true;
3131

3232
public static GoCodeInsightSettings getInstance() {

tests/com/goide/codeInsight/imports/GoOptimizeImportsOnTheFlyTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ public void setUp() throws Exception {
2626
super.setUp();
2727
setUpProjectSdk();
2828
((CodeInsightTestFixtureImpl)myFixture).canChangeDocumentDuringHighlighting(true);
29-
GoCodeInsightSettings.getInstance().setOptimizeImportsOnTheFly(true);
3029
}
3130

3231
@Override
3332
protected void tearDown() throws Exception {
34-
GoCodeInsightSettings.getInstance().setOptimizeImportsOnTheFly(false);
3533
super.tearDown();
3634
}
3735

tests/com/goide/inspections/GoHighlightingTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.goide.inspections;
1818

1919
import com.goide.GoCodeInsightFixtureTestCase;
20+
import com.goide.codeInsight.imports.GoCodeInsightSettings;
2021
import com.goide.inspections.unresolved.*;
2122
import com.goide.project.GoModuleLibrariesService;
2223
import com.intellij.openapi.command.WriteCommandAction;
@@ -54,6 +55,13 @@ public void setUp() throws Exception {
5455
GoTestSignaturesInspection.class,
5556
GoAssignmentNilWithoutExplicitType.class
5657
);
58+
GoCodeInsightSettings.getInstance().setOptimizeImportsOnTheFly(false);
59+
}
60+
61+
@Override
62+
protected void tearDown() throws Exception {
63+
GoCodeInsightSettings.getInstance().setOptimizeImportsOnTheFly(true);
64+
super.tearDown();
5765
}
5866

5967
private void doTest() {

tests/com/goide/inspections/GoTestSignaturesInspectionTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,23 @@
1616

1717
package com.goide.inspections;
1818

19+
import com.goide.codeInsight.imports.GoCodeInsightSettings;
1920
import com.goide.quickfix.GoQuickFixTestBase;
2021
import com.intellij.testFramework.LightProjectDescriptor;
2122

2223
public class GoTestSignaturesInspectionTest extends GoQuickFixTestBase {
24+
@Override
25+
protected void tearDown() throws Exception {
26+
GoCodeInsightSettings.getInstance().setOptimizeImportsOnTheFly(true);
27+
super.tearDown();
28+
}
29+
2330
@Override
2431
protected void setUp() throws Exception {
2532
super.setUp();
2633
setUpProjectSdk();
2734
myFixture.enableInspections(GoTestSignaturesInspection.class);
35+
GoCodeInsightSettings.getInstance().setOptimizeImportsOnTheFly(false);
2836
}
2937

3038
@Override

0 commit comments

Comments
 (0)