Skip to content

Optimize imports command doesn't resolve imports automatically #30296

Open
@JFixby

Description

@JFixby

Reproduction steps:

Example project: https://github.com/JFixby/DartImportsExample

class A located in the lib/folderA/class_a_file.dart
content:

class A {
  static String fieldF = "";
}

class C located in the lib/class_c_depends_on_a.dart depends on the A
content:


class C {
  C() {
       A instanceOfB = new A(); //missing import
  }
}

What was done

click Code -> Optimize imports

image

What is expected

File class_c_depends_on_a.dart gets a new line import 'package:project_a/folderA/class_a_file.dart';

What is actually happening

nothing

Setup

IDEA version: community 2017.2
Dart plugin: 172.3317.48

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-serverIssues related to some aspect of the analysis servertype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions