File: commentsVariables.ts

package info (click to toggle)
node-typescript 4.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 396,552 kB
  • sloc: javascript: 1,444,377; makefile: 7; sh: 3
file content (98 lines) | stat: -rw-r--r-- 3,069 bytes parent folder | download | duplicates (6)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/// <reference path='fourslash.ts' />

/////** This is my variable*/
////var myV/*1*/ariable = 10;
/////*2*/
/////** d variable*/
////var d = 10;
////myVariable = d;
/////*3*/
/////** foos comment*/
////function foo() {
////}
/////** fooVar comment*/
////var foo/*12*/Var: () => void;
/////*4*/
////f/*5q*/oo(/*5*/);
////fo/*6q*/oVar(/*6*/);
////fo/*13*/oVar = f/*14*/oo;
/////*7*/
////f/*8q*/oo(/*8*/);
////foo/*9q*/Var(/*9*/);
////var fooVarVar = /*9aq*/fooVar;
/////**class comment*/
////class c {
////    /** constructor comment*/
////    constructor() {
////    }
////}
/////**instance comment*/
////var i = new c();
/////*10*/
/////** interface comments*/
////interface i1 {
////}
/////**interface instance comments*/
////var i1_i: i1;
/////*11*/
////function foo2(a: number): void;
////function foo2(b: string): void;
////function foo2(aOrb) {
////}
////var x = fo/*15*/o2;

verify.quickInfoAt("1", "var myVariable: number", "This is my variable");

verify.completions(
    {
        marker: "2",
        includes: { name: "myVariable", text: "var myVariable: number", documentation: "This is my variable" },
    },
    {
        marker: "3",
        includes: [
            { name: "myVariable", text: "var myVariable: number", documentation: "This is my variable" },
            { name: "d", text: "var d: number", documentation: "d variable" }
        ],
    },
    {
        marker: "4",
        includes: [
            { name: "foo", text: "function foo(): void", documentation: "foos comment" },
            { name: "fooVar", text: "var fooVar: () => void", documentation:"fooVar comment" },
        ]
    },
)

verify.signatureHelp({ marker: "5", docComment: "foos comment" });
verify.quickInfoAt("5q", "function foo(): void", "foos comment");

verify.signatureHelp({ marker: "6", docComment: "fooVar comment" });
verify.quickInfoAt("6q", "var fooVar: () => void", "fooVar comment");

verify.completions({
    marker: "7",
    includes: [
        { name: "foo", text: "function foo(): void", documentation: "foos comment" },
        { name: "fooVar", text: "var fooVar: () => void", documentation:"fooVar comment" },
    ],
});

verify.signatureHelp({ marker: "8", docComment: "foos comment" });
verify.quickInfoAt("8q", "function foo(): void", "foos comment");

verify.signatureHelp({ marker: "9", docComment: "fooVar comment" });
verify.quickInfos({
    "9q": ["var fooVar: () => void", "fooVar comment"],
    "9aq": ["var fooVar: () => void", "fooVar comment"]
});

verify.completions({ marker: "10", includes: { name: "i", text: "var i: c", documentation: "instance comment" } });
verify.completions({ marker: "11", includes: { name: "i1_i", text: "var i1_i: i1", documentation: "interface instance comments" } });

verify.quickInfos({
    12: ["var fooVar: () => void", "fooVar comment"],
    13: ["var fooVar: () => void", "fooVar comment"],
    14: ["function foo(): void", "foos comment"],
    15: "function foo2(a: number): void (+1 overload)"
});