mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 16:39:46 -05:00
Clear jsDocCache for reused nodes (#21099)
This commit is contained in:
@@ -1679,6 +1679,11 @@ namespace ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if ((node as JSDocContainer).jsDocCache) {
|
||||
// jsDocCache may include tags from parent nodes, which might have been modified.
|
||||
(node as JSDocContainer).jsDocCache = undefined;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
14
tests/cases/fourslash/editClearsJsDocCache.ts
Normal file
14
tests/cases/fourslash/editClearsJsDocCache.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// @allowJs: true
|
||||
|
||||
// @Filename: /a.js
|
||||
/////** @type {/*type*/number} */
|
||||
////let /*x*/x;
|
||||
|
||||
verify.quickInfoAt("x", "let x: number");
|
||||
|
||||
goTo.marker("type");
|
||||
edit.replace(test.markers()[0].position, "number".length, "string");
|
||||
|
||||
verify.quickInfoAt("x", "let x: string");
|
||||
Reference in New Issue
Block a user