Skip to content

For loop variable can't be renamed #4626

Closed

Description

@lukehutch

Describe the bug

Given the following code, placing the cursor by the first x and hitting F2 shows "The element can't be renamed".

Placing the cursor by the second x and hitting F2 allows the variable to be renamed.

    for (final x in []) {
      print(x);
    }

Please complete the following information:

  • Operating System and version: Fedora Linux
  • VS Code version: 1.79.2
  • Dart extension version: 3.68.0
  • Dart/Flutter SDK version: Dart 3.0.5 / Flutter 3.10.5
  • Target device (if the issue relates to Flutter debugging): N/A

Activity

  1. DanTup commented on Jul 5, 2023

    @DanTup
    Member

    This one has already been fixed via dart-lang/sdk#52149 and should show up in the next SDK release.

  2. lukehutch commented on Jul 5, 2023

    @lukehutch
    Author

    Thanks, Dan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions