File: commentsFunctionDeclaration.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 (61 lines) | stat: -rw-r--r-- 2,227 bytes parent folder | download | duplicates (2)
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
/// <reference path='fourslash.ts' />

/////** This comment should appear for foo*/
////function f/*1*/oo() {
////}
////f/*2*/oo/*3*/(/*4*/);
/////** This is comment for function signature*/
////function fo/*5*/oWithParameters(/** this is comment about a*/a: string,
////    /** this is comment for b*/
////    b: number) {
////    var /*6*/d = /*7*/a;
////}
////fooWithParam/*8*/eters/*9*/(/*10*/"a",/*11*/10);

// ambient declaration
/////**
////* Does something
////* @param a a string
////*/
////declare function fn(a: string);
////fn(/*12*/"hello");

verify.quickInfoAt("1", "function foo(): void", "This comment should appear for foo");

verify.quickInfoAt("2", "function foo(): void", "This comment should appear for foo");

verify.completions({ marker: "3", includes: { name: "foo", text: "function foo(): void", documentation: "This comment should appear for foo" }})

verify.signatureHelp({ marker: "4", docComment: "This comment should appear for foo" });

verify.quickInfoAt("5", "function fooWithParameters(a: string, b: number): void", "This is comment for function signature");

verify.quickInfoAt("6", "(local var) d: string");

verify.completions({
    marker: "7",
    includes: [
        { name: "a", text: "(parameter) a: string", documentation: "this is comment about a" },
        { name: "b", text: "(parameter) b: number", documentation: "this is comment for b" },
    ],
    isNewIdentifierLocation: true,
});

verify.quickInfoAt("8", "function fooWithParameters(a: string, b: number): void", "This is comment for function signature");

goTo.marker('9');
verify.completions({
    marker: "9",
    includes: { name: "fooWithParameters", text: "function fooWithParameters(a: string, b: number): void", documentation: "This is comment for function signature" }
})

verify.signatureHelp(
    { marker: "10", docComment: "This is comment for function signature", parameterDocComment: "this is comment about a" },
    { marker: "11", docComment: "This is comment for function signature", parameterDocComment: "this is comment for b" },
    {
        marker: "12",
        docComment: "Does something",
        parameterDocComment: "a string",
        tags: [{ name: "param", text: "a a string" }],
    },
);