Skip to content

Renaming a local variable does not update references in a workspace with overlapped analysis roots, depending on the paths #5548

@Zekfad

Description

@Zekfad

Describe the bug
Rename only applied to first parameter declaration, when analysis server works in a specific configuration.

This bug is only seems to occur when sub package is VS Code WS folder and root folder is also VS Code WS folder and there is analysis_options.yaml file in sub package.

Removing analysis_options.yaml or root folder from VS Code workspace mitigates the issue.

To Reproduce

  • Create pub workspace in project folder
  • Create submodule in a subfolder
  • Add subfolder and project folders as VS Code workspace folders
  • Create analays_options.yaml in submodule
  • Try to rename a symbol

Attaching example environment.
Open test.code-workspace and try to rename variable a in main.dart.
dart_code_test.zip

Expected behavior
Should work as normal.

Screenshots

Image

Image

Please complete the following information:

You can run the Dart: Collect Diagnostic Information command from the VS Code command palette (F1) to easily capture this information or provide it manually.

  • Operating System and version: Microsoft Windows [Version 10.0.19045.5854]
  • VS Code version: 1.101.0 dfaf44141ea9deb3b4096f7cd6d24e00c147a4b1 x64
  • Dart extension version: v3.113.20250611
  • Dart/Flutter SDK version:
    Flutter 3.32.3 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision 5c1433509f (3 days ago) • 2025-06-11 13:12:24 -0700
    Engine • revision 31c4875c7a (9 days ago) • 2025-06-05 08:39:10 -0700
    Tools • Dart 3.8.1 • DevTools 2.45.1

Analysis server log:
Dart-Code-Log-2025-05-00 04-03-44.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions