Skip to content

Renaming a symbol adds an extra dot in Dart doc comments, breaks link between symbol and reference #2816

@rmkl

Description

@rmkl

Describe the bug
Renaming a named constructor or a factory results in duplicating the dot in any doc comment that is referencing that symbol. It breaks the link between the symbol and the reference for any subsequent renaming.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new class SomeClass
  2. Add a named constructor SomeClass.namedConstructor
  3. Add a doc comment to the named constructor that includes a Dart doc reference [SomeClass.namedConstructor]
  4. Right-click the name of the named constructor in the code
  5. Select 'Rename Symbol' (F2)
  6. Change the name to 'anotherName'
  7. Notice how an extra dot is added to the reference in the doc comment [SomeClass..anotherName]
  8. The link between the symbol and the reference is the doc comment is now lost.
  • The steps to reproduce the issue for a factory are the same.
  • Disabling all extensions, except the Dart extension, does not resolve the problem.

Versions (please complete the following information):

  • VS Code version: 1.49.1
  • Dart extension version: 3.14.1
  • Dart/Flutter SDK version: Flutter 1.21.0-9.2.pre • channel beta, Dart SDK version: 2.10.0-7.3.beta

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions