akinsho / flutter-tools.nvim

Tools to help create flutter apps in neovim using the native lsp
MIT License
935 stars 75 forks source link

[BUG] FlutterRename command not updating imports #289

Closed m-salman-a closed 9 months ago

m-salman-a commented 9 months ago

Is there an existing issue for this?

Current Behavior

The FlutterRename command doesn't update import for another file if the other file is already opened in a different buffer

Expected Behavior

FlutterRename renames the class, file name, and updates the import.

Steps To Reproduce

  1. Open two dart files in two different buffers, one with an import to the other. (ex. a main.dart and MyWidget.dart)
  2. Use :FlutterRename on the Dart class (ex. MyWidget -> MyNewWidget)
  3. The class and file name will change, but the import will not update.
  4. An error will be logged to stdout:
image

Environment

- OS: macOS Ventura 13.5.2
- Flutter version: 3.10.6
- Is flutter in $PATH: true
- neovim version: 0.9.1
- LSP Settings:
  - renameFilesWithClasses = "always",
  - updateImportsOnRename = true,

Anything else?

No response