question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect package renaming when moving file to another directory

See original GitHub issue

Step1. Move file “code_panel.dart” to another directory

step1

Step2. Click “OK” in popup window

step2

Step3. Incorrect import renaming

step3

flutter doctor -v

[√] Flutter (Channel master, 1.21.0-6.0.pre.169, on Microsoft Windows [Version 10.0.18363.535], locale en-US)
    • Flutter version 1.21.0-6.0.pre.169 at c:\flutter
    • Framework revision 0e558042d7 (24 hours ago), 2020-08-04 11:36:04 -0400
    • Engine revision 033dd45607
    • Dart version 2.10.0 (build 2.10.0-2.0.dev 0f0e04ec3a)


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\ilopX\AppData\Local\Android\sdk
    • Platform android-29, build-tools 29.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Enterprise 2019 16.4.2)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
    • Visual Studio Enterprise 2019 version 16.4.29613.14
    • Windows 10 SDK version 10.0.18362.0

[√] Android Studio (version 3.5)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] IntelliJ IDEA Ultimate Edition (version 2019.3)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2019.3.1
    • Flutter plugin version 45.1.2
    • Dart plugin version 193.7361

[√] Connected device (3 available)
    • Windows (desktop) • windows    • windows-x64    • Microsoft Windows [Version 10.0.18363.535]
    • Web Server (web)  • web-server • web-javascript • Flutter Tools
    • Chrome (web)      • chrome     • web-javascript • Google Chrome 84.0.4147.105

• No issues found!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:12
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
iulian0512commented, Feb 4, 2021

still occurring in AStudio 4.1.2 flutter plugin 53.0.1 dart plugin 201.9317

3reactions
rydmikecommented, Aug 10, 2020

I can confirm this for Dart/Flutter projects. It has always done this. It is not new.

An interesting detail is that the result varies:

  1. If the file being moved, is referenced elsewhere with a relative path name in it’s import, then the rename for the move works correctly!

  2. If the file being moved, is referenced elsewhere with a package import, like in the above example, then the rename fails and it gets a weird file reference like above. It should in that case keep the packages reference with the path corrected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

problem with moving files using os.rename - Stack Overflow
i have this block of code where i try to move all the files in a folder to a different folder.
Read more >
Invalid argument argument when moving files - Ask Ubuntu
You can rename a folder to a name with slashes in it, as long as it's a valid path to somewhere. What you...
Read more >
Rename or Move files in GIT - Aram Koukia
Problem. In your Git working directory, you wish to rename a previously committed file named mycoolclass.cs to myCoolClass.cs and commit the newly renamed...
Read more >
SSIS: File System Task Move and rename files in one step
In some ETL scenarios, when processing files, it is necessary to rename the already processed files and move them to a different location....
Read more >
File move / refactoring not working
I'm working with classes in a packages/ folder, which are found quite happily in the rest of the app, but when I move...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found