File: commentsFunctionDeclaration.ts

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (56 lines) | stat: -rw-r--r-- 2,111 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
/// <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");

goTo.marker('3');
verify.completionListContains('foo', 'function foo(): void', 'This comment should appear for foo');

goTo.marker('4');
verify.currentSignatureHelpDocCommentIs("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");

goTo.marker('7');
verify.completionListContains('a', '(parameter) a: string', 'this is comment about a');
verify.completionListContains('b', '(parameter) b: number', 'this is comment for b');

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

goTo.marker('9');
verify.completionListContains('fooWithParameters', 'function fooWithParameters(a: string, b: number): void', 'This is comment for function signature');

goTo.marker('10');
verify.currentSignatureHelpDocCommentIs("This is comment for function signature");
verify.currentParameterHelpArgumentDocCommentIs("this is comment about a");

goTo.marker('11');
verify.currentSignatureHelpDocCommentIs("This is comment for function signature");
verify.currentParameterHelpArgumentDocCommentIs("this is comment for b");

goTo.marker('12');
verify.currentSignatureHelpDocCommentIs("Does something");
verify.currentParameterHelpArgumentDocCommentIs("a string");