Skip to content

Imports refactoring: changing import folder fails to update dependent classes #30294

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:

import 'package:project_a/folderA/class_a_file.dart';

class C {
  C() {
    A.fieldF;
  }
}

What was done

rename the folder lib/folderA/ to any name like lib/folderX/

What is expected

refactoring updates class C with the new path
the import should become import 'package:project_a/folderX/class_a_file.dart';

What is actually happening

no update, class see is pointing to the missing old import

Refactoring preview shows no dependent classes:

image

renaming leads to a compile error:

image

Setup

IDEA version: community 2017.2
Dart plugin: 172.3317.48

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-intellijTracking issues for the Dart IntelliJ plugin.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions