@@ -283,12 +283,6 @@ namespace ts {
283
283
}
284
284
}
285
285
286
- enum ContextualDocumentationType {
287
- None = "None" ,
288
- GetAccessor = "GetAccessor" ,
289
- SetAccessor = "SetAccessor"
290
- }
291
-
292
286
class SymbolObject implements Symbol {
293
287
flags : SymbolFlags ;
294
288
escapedName : __String ;
@@ -299,7 +293,8 @@ namespace ts {
299
293
// symbol has no doc comment, then the empty array will be returned.
300
294
documentationComment ?: SymbolDisplayPart [ ] ;
301
295
302
- contextualDocumentationComment ?: Map < SymbolDisplayPart [ ] > ;
296
+ contextualGetAccessorDocumentationComment ?: SymbolDisplayPart [ ] ;
297
+ contextualSetAccessorDocumentationComment ?: SymbolDisplayPart [ ] ;
303
298
304
299
// Undefined is used to indicate the value has not been computed. If, after computing, the
305
300
// symbol has no JSDoc tags, then the empty array will be returned.
@@ -341,24 +336,22 @@ namespace ts {
341
336
getContextualDocumentationComment ( context : Node | undefined , checker : TypeChecker | undefined ) : SymbolDisplayPart [ ] {
342
337
switch ( context ?. kind ) {
343
338
case SyntaxKind . GetAccessor :
344
- return this . getContextualDocumentationCommentCached ( ContextualDocumentationType . GetAccessor , filter ( this . declarations , isGetAccessor ) , checker ) ;
339
+ if ( ! this . contextualGetAccessorDocumentationComment ) {
340
+ this . contextualGetAccessorDocumentationComment = emptyArray ;
341
+ this . contextualGetAccessorDocumentationComment = getDocumentationComment ( filter ( this . declarations , isGetAccessor ) , checker ) ;
342
+ }
343
+ return this . contextualGetAccessorDocumentationComment
345
344
case SyntaxKind . SetAccessor :
346
- return this . getContextualDocumentationCommentCached ( ContextualDocumentationType . SetAccessor , filter ( this . declarations , isSetAccessor ) , checker ) ;
345
+ if ( ! this . contextualSetAccessorDocumentationComment ) {
346
+ this . contextualSetAccessorDocumentationComment = emptyArray ;
347
+ this . contextualSetAccessorDocumentationComment = getDocumentationComment ( filter ( this . declarations , isSetAccessor ) , checker ) ;
348
+ }
349
+ return this . contextualSetAccessorDocumentationComment
347
350
default :
348
351
return this . getDocumentationComment ( checker ) ;
349
352
}
350
353
}
351
354
352
- getContextualDocumentationCommentCached ( type : ContextualDocumentationType , declarations : Declaration [ ] , checker : TypeChecker | undefined ) : SymbolDisplayPart [ ] {
353
- if ( ! this . contextualDocumentationComment ) {
354
- this . contextualDocumentationComment = createMultiMap < SymbolDisplayPart > ( ) ;
355
- }
356
- if ( ! this . contextualDocumentationComment . has ( type ) ) {
357
- this . contextualDocumentationComment . set ( type , getDocumentationComment ( declarations , checker ) ) ;
358
- }
359
- return this . contextualDocumentationComment . get ( type ) ! ;
360
- }
361
-
362
355
getJsDocTags ( ) : JSDocTagInfo [ ] {
363
356
if ( this . tags === undefined ) {
364
357
this . tags = JsDoc . getJsDocTagsFromDeclarations ( this . declarations ) ;
0 commit comments