dikatok · GitHub

Renaming element name in iterable.map is not working

To Reproduce

  1. Call .map to an iterable like below.
final List<String> list = [];
final list2 = list.map((element) => element).toList();
  1. Rename the element to something else using F2 key.

  2. Nothing happens and there is a warning/error popup stating An error occurred while handling textDocument/rename request.

Expected behavior
Variable is renamed.

Screenshots

Image

Please complete the following information:

Dart Code extension: 3.109.20250404
Flutter extension: 3.109.20250401 (activated)
App: Visual Studio Code
App Host: desktop
Version: mac 1.99.3
Workspace type: Flutter (LSP)
Workspace name: tokowijaya
Dart (3.7.0): /Users/dikatok/flutter/bin/cache/dart-sdk
Flutter (3.29.1): /Users/dikatok/flutter (No device)

Read the original on github.com ↗