Skip to content

An error occurred while handling textDocument/rename request #5496

@dikatok

Description

@dikatok

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions