Skip to content

Commit 3d47343

Browse files
committed
improve tests and parser
1 parent 2611909 commit 3d47343

File tree

3 files changed

+63
-2
lines changed

3 files changed

+63
-2
lines changed

src/compiler/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7588,7 +7588,7 @@ namespace ts {
75887588
return lookAhead(() => {
75897589
parseOptional(SyntaxKind.OpenBraceToken);
75907590
return isIdentifier();
7591-
})
7591+
});
75927592
}
75937593

75947594
function parseBracketNameInPropertyAndParamTag(): { name: EntityName, isBracketed: boolean } {

tests/cases/fourslash/jsDocSee1.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//// }
66

77
//// namespace NS {
8-
//// export interface [| /*def2*/Bar|] {
8+
//// export interface [|/*def2*/Bar|] {
99
//// baz: Foo
1010
//// }
1111
//// }
@@ -16,8 +16,26 @@
1616
//// /** @see {NS./*use2*/[|Bar|]} ns.bar*/
1717
//// const b = ""
1818

19+
//// /** @see /*use3*/[|Foo|] f1*/
20+
//// const c = ""
21+
22+
//// /** @see NS./*use4*/[|Bar|] ns.bar*/
23+
//// const [|/*def3*/d|] = ""
24+
25+
//// /** @see /*use5*/[|d|] dd*/
26+
//// const e = ""
27+
1928
goTo.marker("use1");
2029
verify.goToDefinitionIs("def1");
2130

2231
goTo.marker("use2");
2332
verify.goToDefinitionIs("def2");
33+
34+
goTo.marker("use3");
35+
verify.goToDefinitionIs("def1");
36+
37+
goTo.marker("use4");
38+
verify.goToDefinitionIs("def2");
39+
40+
goTo.marker("use5");
41+
verify.goToDefinitionIs("def3");

tests/cases/fourslash/jsDocSee2.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
///<reference path="fourslash.ts" />
2+
3+
//// /** @see {/*use1*/[|foooo|]} unknown reference*/
4+
//// const a = ""
5+
6+
//// /** @see {/*use2*/[|@bar|]} invalid tag*/
7+
//// const b = ""
8+
9+
//// /** @see /*use3*/[|foooo|] unknown reference without brace*/
10+
//// const c = ""
11+
12+
//// /** @see /*use4*/[|@bar|] invalid tag without brace*/
13+
//// const [|/*def1*/d|] = ""
14+
15+
//// /** @see {/*use5*/[|d@fff|]} partial reference */
16+
//// const e = ""
17+
18+
//// /** @see /*use6*/[|@@@@@@|] total invalid tag*/
19+
//// const f = ""
20+
21+
//// /** @see d@{/*use7*/[|fff|]} partial reference */
22+
//// const g = ""
23+
24+
goTo.marker("use1");
25+
verify.goToDefinition([]);
26+
27+
goTo.marker("use2");
28+
verify.goToDefinition([]);
29+
30+
goTo.marker("use3");
31+
verify.goToDefinition([]);
32+
33+
goTo.marker("use4");
34+
verify.goToDefinition([]);
35+
36+
goTo.marker("use5");
37+
verify.goToDefinitionIs("def1");
38+
39+
goTo.marker("use6");
40+
verify.goToDefinition([]);
41+
42+
goTo.marker("use7");
43+
verify.goToDefinition([]);

0 commit comments

Comments
 (0)