mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-16 05:58:32 -06:00
Clear jsDocCache for reused nodes (#21099)
This commit is contained in:
parent
82fb294924
commit
191b9750c3
@ -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");
|
||||
Loading…
x
Reference in New Issue
Block a user