You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Go-to-definition in JSDoc tag followed by diagnostics request incorrectly creates new errors #50341
declareclassStuff{/** 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
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;////}constrange=test.ranges()[0];goTo.selectRange(range);verify.goToDefinitionIs("checkFooIsDef");verify.noErrors();
changed the title [-]Sequentially editing `@link` content, running go-to-definition, then diagnostics, incorrectly creates new errors[/-][+]Go-to-definition in `@link` tag followed by diagnostics request incorrectly creates new errors[/+]on Aug 17, 2022
If you do the same sort thing - run a semantic operation on UnresolvedTypeReference, and then request errors - then you'll start seeing errors in the JSDoc, even in a .ts file.
changed the title [-]Go-to-definition in `@link` tag followed by diagnostics request incorrectly creates new errors[/-][+]Go-to-definition in JSDoc tag followed by diagnostics request incorrectly creates new errors[/+]on Aug 17, 2022
Activity
[-]Sequentially editing `@link` content, running go-to-definition, then diagnostics, incorrectly creates new errors[/-][+]Go-to-definition in `@link` tag followed by diagnostics request incorrectly creates new errors[/+]DanielRosenwasser commentedon Aug 17, 2022
Unfortunately this isn't related to the
@linktag - I think it occurs in any JSDoc that might try to resolve.If you do the same sort thing - run a semantic operation on
UnresolvedTypeReference, and then request errors - then you'll start seeing errors in the JSDoc, even in a.tsfile.[-]Go-to-definition in `@link` tag followed by diagnostics request incorrectly creates new errors[/-][+]Go-to-definition in JSDoc tag followed by diagnostics request incorrectly creates new errors[/+]DanielRosenwasser commentedon Aug 17, 2022
#49109 seems strongly related.
DanielRosenwasser commentedon Oct 6, 2022
Another
Type in
this[""]and you'll get the error:fix jsdoc errors in .ts in tsserver