英文:
VSCode Dart/Flutter not rename import when rename the file
问题
我正在使用VSCode编写Dart/Flutter代码。
如何修复在重命名.dart文件时,VSCode没有重命名所有导入的问题?
这是扩展的错误还是未实现的功能?
英文:
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?
答案1
得分: 7
这是一个未实现的功能。
最初,VS Code和Dart分析服务器中的API不兼容(VS Code只会在文件重命名后告诉我们,但Dart服务器需要在重命名之前知道以创建正确的编辑)。
最近有所改变 - 现在VS Code具有允许我们在重命名之前插入的API,但这尚未在Dart扩展中实现。
要获得实现后的通知,请订阅Dart-Code问题(否则,当完成时它将包含在发布说明中)。
英文:
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).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论