Skip to content

Go-to-definition in JSDoc tag followed by diagnostics request incorrectly creates new errors #50341

Closed
@DanielRosenwasser

Description

@DanielRosenwasser
declare class Stuff {
    /** For more thorough tests, use {@link checkBarIs} */
    checkFooLengthIs(len: number): void;

    checkFooIs(value: object): void;
}

Currently, this .ts file produces no errors.

However, if you very-quickly replace checkBarIs with checkFooIs in the above example by double-clicking and pasting in the new text, then VS Code will sometimes then make a definitionAndBoundSpan request. That request will get served, and then the editor will request errors. The errors returned then become nonsensical.

Expected: No errors
Actual:

  • Line 2:45-55 - "Cannot find name 'checkFooIs'. Did you mean the instance member 'this.checkFooIs'?"
  • Line 3:5-21 - "Cannot find name 'checkFooIs'."

Here's a GIF of this in action

jsdocFastTypingInLinkTag


Here's a relevant fourslash test that currently fails.

/// <reference path="./fourslash.ts" />

////declare class Stuff {
////    /** For more thorough tests, use {@link [|checkFooIs|]} */
////    checkFooLengthIs(len: number): void;
////
////    /*checkFooIsDef*/checkFooIs(value: object): void;
////}

const range = test.ranges()[0];
goTo.selectRange(range);
verify.goToDefinitionIs("checkFooIsDef");
verify.noErrors();

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestone

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions