File tree Expand file tree Collapse file tree 4 files changed +45
-1
lines changed
baselines/reference/JSDocParsing
cases/user/TypeScript-Node-Starter Expand file tree Collapse file tree 4 files changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -6567,6 +6567,16 @@ namespace ts {
6567
6567
indent += whitespace . length ;
6568
6568
}
6569
6569
break ;
6570
+ case SyntaxKind . OpenBraceToken :
6571
+ state = JSDocState . SavingComments ;
6572
+ if ( lookAhead ( ( ) => nextJSDocToken ( ) === SyntaxKind . AtToken && tokenIsIdentifierOrKeyword ( nextJSDocToken ( ) ) && scanner . getTokenText ( ) === "link" ) ) {
6573
+ pushComment ( scanner . getTokenText ( ) ) ;
6574
+ nextJSDocToken ( ) ;
6575
+ pushComment ( scanner . getTokenText ( ) ) ;
6576
+ nextJSDocToken ( ) ;
6577
+ }
6578
+ pushComment ( scanner . getTokenText ( ) ) ;
6579
+ break ;
6570
6580
case SyntaxKind . AsteriskToken :
6571
6581
if ( state === JSDocState . BeginningOfLine ) {
6572
6582
// leading asterisks start recording on the *next* (non-whitespace) token
Original file line number Diff line number Diff line change @@ -308,6 +308,12 @@ namespace ts {
308
308
* @param {object} o Doc doc
309
309
* @param {string} o.f Doc for f
310
310
*/` ) ;
311
+ parsesCorrectly ( "" ,
312
+ `/**
313
+ * {@link first link}
314
+ * Inside {@link link text} thing
315
+ * @see {@link second link text} and {@link Foo|a foo} as well.
316
+ */` ) ;
311
317
} ) ;
312
318
} ) ;
313
319
describe ( "getFirstToken" , ( ) => {
Original file line number Diff line number Diff line change
1
+ {
2
+ "kind" : " JSDocComment" ,
3
+ "pos" : 0 ,
4
+ "end" : 127 ,
5
+ "tags" : {
6
+ "0" : {
7
+ "kind" : " JSDocTag" ,
8
+ "pos" : 63 ,
9
+ "end" : 68 ,
10
+ "atToken" : {
11
+ "kind" : " AtToken" ,
12
+ "pos" : 63 ,
13
+ "end" : 64
14
+ },
15
+ "tagName" : {
16
+ "kind" : " Identifier" ,
17
+ "pos" : 64 ,
18
+ "end" : 67 ,
19
+ "escapedText" : " see"
20
+ },
21
+ "comment" : " {@link second link text} and {@link Foo|a foo} as well."
22
+ },
23
+ "length" : 1 ,
24
+ "pos" : 63 ,
25
+ "end" : 68
26
+ },
27
+ "comment" : " {@link first link}\n Inside {@link link text} thing"
28
+ }
You can’t perform that action at this time.
0 commit comments