Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode Dart/Flutter not rename import when rename the file

I'm coding Dart/Flutter in VSCode.

How to fix the problem where VSCode did not rename all import when I rename .dart file?

Is this the extensions bug or it's an unimplemented feature?

like image 421
b.ben Avatar asked Jan 06 '20 12:01

b.ben


1 Answers

This is an unimplemented feature.

Originally the APIs in VS Code and the Dart analysis server were not compatible (VS Code would only tell us after the file was renamed, but the Dart server needed to know before the rename to create the correct edits).

This has recently changed - VS Code now has APIs that allow us to hook into the rename before it happens, but it hasn't been implemented in the Dart extension yet.

For notification when it is implemented, you can subscribe to this Dart-Code issue (otherwise, it'll be included in the release notes when it's done).

like image 121
Danny Tuppeny Avatar answered Oct 30 '22 19:10

Danny Tuppeny