VSCode Dart/Flutter 在重命名文件时未重命名导入

huangapple go评论93阅读模式
英文:

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).

huangapple
  • 本文由 发表于 2020年1月6日 20:33:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/59612207.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定