| Index: pkg/analysis_server/lib/src/services/correction/organize_directives.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/correction/organize_directives.dart b/pkg/analysis_server/lib/src/services/correction/organize_directives.dart
|
| index b12ecb138b6dcebba5b05aa8874da0709bc69883..c7ea89ec154abb117601fd5a9e63ed5d2b4851dd 100644
|
| --- a/pkg/analysis_server/lib/src/services/correction/organize_directives.dart
|
| +++ b/pkg/analysis_server/lib/src/services/correction/organize_directives.dart
|
| @@ -9,7 +9,6 @@ import 'package:analysis_server/src/services/correction/strings.dart';
|
| import 'package:analyzer/src/generated/ast.dart';
|
| import 'package:analyzer/src/generated/error.dart';
|
| import 'package:analyzer/src/generated/scanner.dart';
|
| -import 'dart:math';
|
|
|
| /**
|
| * Organizer of directives in the [unit].
|
| @@ -57,7 +56,8 @@ class DirectiveOrganizer {
|
|
|
| bool _isUnusedImport(UriBasedDirective directive) {
|
| for (AnalysisError error in errors) {
|
| - if (error.errorCode == HintCode.UNUSED_IMPORT &&
|
| + if ((error.errorCode == HintCode.DUPLICATE_IMPORT ||
|
| + error.errorCode == HintCode.UNUSED_IMPORT) &&
|
| directive.uri.offset == error.offset) {
|
| return true;
|
| }
|
|
|