Skip to content

Commit

Permalink
Temporarily disable removal of unused imports (#917)
Browse files Browse the repository at this point in the history
* chore: disable optimize

* chore: commenting out the import optimise for now

* chore: commenting out the import optimise for now

* chore: commenting out the import optimise for now

* chore: test Disabled Temperately

* chore: amended the test

* chore: amended the test
  • Loading branch information
PayalKhanna authored Feb 6, 2025
1 parent 61c5ad4 commit 5f43508
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class QuickFixTest extends AbstractRosettaLanguageServerTest {
sorted.get(0)=> [
assertEquals("Optimize imports", title)
edit.changes.values.head.head => [
assertEquals("import dsl.foo.*", newText) // second import is deleted
assertEquals("import dsl.bar.*\nimport dsl.foo.*", newText) // second import is deleted
assertEquals(new Position(2, 0), range.start)
assertEquals(new Position(3, 16), range.end)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ public class ImportManagementService {
public void cleanupImports(RosettaModel model) {
EList<Import> imports = model.getImports();

//TODO need to rework on findUnused so that it can work on parent model imports as well
// remove all duplicate/unused imports
List<Import> unusedImports = findUnused(model);
imports.removeAll(unusedImports);
/*List<Import> unusedImports = findUnused(model);
imports.removeAll(unusedImports);*/

List<Import> duplicateImports = findDuplicates(imports);
imports.removeAll(duplicateImports);
Expand Down

0 comments on commit 5f43508

Please sign in to comment.