Skip to content

JSDoc @typedef object literal property rename text includes leading '*' and spaceΒ #43442

@andrewbranch

Description

@andrewbranch

Bug Report

πŸ”Ž Search Terms

JSDoc typedef property rename

πŸ•— Version & Regression Information

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

/**
 * @typedef {{
 *   foo: string;
 *   bar: number;
 * }} Foo
 */

/** @type {Foo} */
const x = {
    foo: "",
    bar: 42 // <-- see document highlight and rename on 'bar'
};

πŸ™ Actual behavior

  1. After renaming a property in x, the * (including spaces) get deleted from the @typedef.

  2. (VS Code only, not Playground) Renaming in the @typedef treats the * as part of the name, and leaving it in adds * to the property declaration in x:

    Kapture 2021-03-30 at 12 21 00

πŸ™‚ Expected behavior

Rename works without breaking source code or comment formatting. Document highlight does not highlight the leading * .

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationDomain: Refactoringse.g. extract to constant or function, rename symbolFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions