File: tripleSlashRefPathCompletionBackandForwardSlash.ts

package info (click to toggle)
node-typescript 4.8.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 523,068 kB
  • sloc: javascript: 1,735,777; makefile: 7; sh: 1
file content (72 lines) | stat: -rw-r--r-- 2,191 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/// <reference path='fourslash.ts' />

// Exercises completions for hidden files (ie: those beginning with '.')

// @Filename: f.ts
//// /*f1*/
// @Filename: d1/g.ts
//// /*g1*/
// @Filename: d1/d2/h.ts
//// /*h1*/
// @Filename: d1/d2/d3/i.ts
//// /// <reference path=".\..\..\/*28*/

// @Filename: test.ts
//// /// <reference path="/*0*/
//// /// <reference path=".//*1*/
//// /// <reference path=".\/*2*/
//// /// <reference path="[|./*3*/|]

//// /// <reference path="d1//*4*/
//// /// <reference path="d1/.//*5*/
//// /// <reference path="d1/.\/*6*/
//// /// <reference path="d1/[|./*7*/|]

//// /// <reference path="d1\/*8*/
//// /// <reference path="d1\.//*9*/
//// /// <reference path="d1\.\/*10*/
//// /// <reference path="d1\[|./*11*/|]

//// /// <reference path="d1/d2//*12*/
//// /// <reference path="d1/d2/.//*13*/
//// /// <reference path="d1/d2/.\/*14*/
//// /// <reference path="d1/d2/[|./*15*/|]

//// /// <reference path="d1/d2\/*16*/
//// /// <reference path="d1/d2\.//*17*/
//// /// <reference path="d1/d2\.\/*18*/
//// /// <reference path="d1/d2\[|./*19*/|]

//// /// <reference path="d1\d2//*20*/
//// /// <reference path="d1\d2/.//*21*/
//// /// <reference path="d1\d2/.\/*22*/
//// /// <reference path="d1\d2/[|./*23*/|]

//// /// <reference path="d1\d2\/*24*/
//// /// <reference path="d1\d2\.//*25*/
//// /// <reference path="d1\d2\.\/*26*/
//// /// <reference path="d1\d2\[|./*27*/|]

testBlock(0,  'f.ts', "d1");
testBlock(4,  'g.ts', "d2");
testBlock(8,  'g.ts', "d2");
testBlock(12, 'h.ts', "d3");
testBlock(16, 'h.ts', "d3");
testBlock(20, 'h.ts', "d3");
testBlock(24, 'h.ts', "d3");
verify.completions({ marker: "28", exact: ["g.ts", "d2"], isNewIdentifierLocation: true });

function testBlock(offset: number, fileName: string, dir: string) {
    const names = [fileName, dir];
    verify.completions(
        {
            marker: [offset, offset + 1, offset + 2].map(String),
            exact: names,
            isNewIdentifierLocation: true,
        },
        {
            marker: String(offset + 3),
            exact: names.map(name => ({ name, replacementSpan: test.ranges()[offset / 4] })),
            isNewIdentifierLocation: true,
        });
}