changed behavior of symbol.getDocumentationComment()
sramam opened this issue · 4 comments
I am interested in expanding the use of JsDoc comments to annotate interface fields with validation criteria. An attempt to use symbol.getDocumentationComment() seems to have different behavior
between 2.0 and 2.1 branches.
Sample doc comment (attached to an interface here, but I don't think that should matter)
export interface Foo {
/**
* a description string
*
* @customTag foo
* @customElse bar
*/
field: string;
};
The intent is to walk the tree of nodes and invoke getDocumentationComment on the symbol for 'field'
(<ts.Symbol>field).getDocumentationComment()
Expected behavior:
// version typescript@2.0.6
[ { text: 'a description string', kind: 'text' },
{ text: '\n', kind: 'lineBreak' },
{ text: '', kind: 'text' },
{ text: '\n', kind: 'lineBreak' },
{ text: '@customTag foo', kind: 'text' },
{ text: '\n', kind: 'lineBreak' },
{ text: '@customElse bar', kind: 'text' } ]
Actual behavior:
// version typescript@2.1.0-dev.20161031
[ { text: 'a description string', kind: 'text' }]
If this is intended behavior, please provide a way to get raw documentation so client applications and extend any default usage.
This change was introduced by #10671 and also broke UWP API documentation comments in VS 15. I'm working on a fix. And by fix I mean some way to get custom jsDoc tags from the language service, not necessarily reverting to the old behavior.
@sramam did the API that @minestarks added in #12856 address your request?
I haven't had a chance to look into this since. closing for now.
I finally got around to looking into this, the API works perfectly. Thanks much @minestarks!