akinsho / flutter-tools.nvim

Tools to help create flutter apps in neovim using the native lsp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] FlutterRename command not updating imports

m-salman-a opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

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