Flutter-intellij: Rename/move directory won't change import

Created on 14 Jan 2020  Â·  10Comments  Â·  Source: flutter/flutter-intellij

Manual search and replace currently required after renaming library directory.
Please add support for automatic refactor of imports.


Version info

[✓] Flutter (Channel beta, v1.12.13+hotfix.6, on Mac OS X 10.15.2 19C57, locale en-IL)
    • Flutter version 1.12.13+hotfix.6 at /usr/local/lib/flutter
    • Framework revision 18cd7a3601 (5 weeks ago), 2019-12-11 06:35:39 -0800
    • Engine revision 2994f7e1e6
    • Dart version 2.7.0


[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/sasha/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/sasha/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/sasha/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3, Build version 11C29
    • CocoaPods version 1.8.4

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] IntelliJ IDEA Community Edition (version 2019.3.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 42.1.4
    • Dart plugin version 193.5731

[✓] VS Code (version 1.41.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.7.1

[✓] Connected device (3 available)
    • iPhone 11 Pro Max • D06766C9-E399-4AEF-B840-D9F00FF661EE • ios            • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)
    • Chrome            • chrome                               • web-javascript • Google Chrome 79.0.3945.117
    • Web Server        • web-server                           • web-javascript • Flutter Tools

• No issues found!

Most helpful comment

The file name changes, directory name changes, and the folder of the files are not auto imported/renamed.

I have a large architecture in-development so this consumes lots of time. Thanks.

All 10 comments

Thanks for the report!

@scheglov do you know about this?

@jwren worked on move / rename refactoring support in DAS.

@ph55 which action/ entry point are you using to rename the directory in IntelliJ? Are all sources within a lib/?

@jwren yes, all directories in lib. Only directories. Renaming files will change imports.

Here for example I change helper to helpers:


Screenshots

image

image

Same will happen for core or common folders (any nesting level)

I am experiencing this issue too. My current plugin version is v43.0.1.

I also still have this problem

Is there a plugin for this perhaps?

Still having this problem on v48

Yes. I have the same issue.

The file name changes, directory name changes, and the folder of the files are not auto imported/renamed.

I have a large architecture in-development so this consumes lots of time. Thanks.

Was this page helpful?
0 / 5 - 0 ratings