2014-07-13 01:04:16 +02:00
|
|
|
//// [commentsFunction.ts]
|
|
|
|
|
|
|
|
/** This comment should appear for foo*/
|
|
|
|
function foo() {
|
2014-08-15 22:40:48 +02:00
|
|
|
} /* trailing comment of function */
|
2014-07-13 01:04:16 +02:00
|
|
|
foo();
|
|
|
|
/** This is comment for function signature*/
|
|
|
|
function fooWithParameters(/** this is comment about a*/a: string,
|
|
|
|
/** this is comment for b*/
|
|
|
|
b: number) {
|
|
|
|
var d = a;
|
2014-08-15 22:40:48 +02:00
|
|
|
} // trailing comment of function
|
2014-07-13 01:04:16 +02:00
|
|
|
fooWithParameters("a", 10);
|
|
|
|
/** fooFunc
|
|
|
|
* comment
|
|
|
|
*/
|
|
|
|
var fooFunc = function FooFunctionValue(/** fooFunctionValue param */ b: string) {
|
|
|
|
return b;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// lamdaFoo var comment
|
|
|
|
var lambdaFoo = /** this is lambda comment*/ (/**param a*/a: number, /**param b*/b: number) => a + b;
|
|
|
|
var lambddaNoVarComment = /** this is lambda multiplication*/ (/**param a*/a: number, /**param b*/b: number) => a * b;
|
|
|
|
lambdaFoo(10, 20);
|
2014-08-15 22:18:54 +02:00
|
|
|
lambddaNoVarComment(10, 20);
|
|
|
|
|
|
|
|
function blah(a: string /* multiline trailing comment
|
|
|
|
multiline */) {
|
|
|
|
}
|
|
|
|
|
|
|
|
function blah2(a: string /* single line multiple trailing comments */ /* second */) {
|
|
|
|
}
|
|
|
|
|
|
|
|
function blah3(a: string // trailing commen single line
|
|
|
|
) {
|
2014-08-15 22:40:48 +02:00
|
|
|
}
|
|
|
|
|
2014-08-16 00:49:09 +02:00
|
|
|
lambdaFoo = (a, b) => a * b; // This is trailing comment
|
|
|
|
|
|
|
|
/*leading comment*/() => 0; // Needs to be wrapped in parens to be a valid expression (not declaration)
|
|
|
|
/*leading comment*/(() => 0); //trailing comment
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
//// [commentsFunction.js]
|
2014-08-14 15:21:30 +02:00
|
|
|
/** This comment should appear for foo*/
|
2014-07-13 01:04:16 +02:00
|
|
|
function foo() {
|
2014-08-15 23:32:08 +02:00
|
|
|
} /* trailing comment of function */
|
2014-07-13 01:04:16 +02:00
|
|
|
foo();
|
2014-08-14 15:21:30 +02:00
|
|
|
/** This is comment for function signature*/
|
2014-08-15 21:17:36 +02:00
|
|
|
function fooWithParameters(a,
|
|
|
|
/** this is comment for b*/
|
2014-08-14 14:47:38 +02:00
|
|
|
b) {
|
2014-07-13 01:04:16 +02:00
|
|
|
var d = a;
|
2014-08-15 22:40:48 +02:00
|
|
|
} // trailing comment of function
|
2014-07-13 01:04:16 +02:00
|
|
|
fooWithParameters("a", 10);
|
2014-08-12 00:54:12 +02:00
|
|
|
/** fooFunc
|
|
|
|
* comment
|
|
|
|
*/
|
2014-07-13 01:04:16 +02:00
|
|
|
var fooFunc = function FooFunctionValue(b) {
|
|
|
|
return b;
|
|
|
|
};
|
2014-08-12 00:54:12 +02:00
|
|
|
/// lamdaFoo var comment
|
2014-07-13 01:04:16 +02:00
|
|
|
var lambdaFoo = function (a, b) { return a + b; };
|
|
|
|
var lambddaNoVarComment = function (a, b) { return a * b; };
|
|
|
|
lambdaFoo(10, 20);
|
|
|
|
lambddaNoVarComment(10, 20);
|
2014-08-15 22:18:54 +02:00
|
|
|
function blah(a /* multiline trailing comment
|
2014-08-15 23:32:08 +02:00
|
|
|
multiline */) {
|
2014-08-15 22:18:54 +02:00
|
|
|
}
|
2014-08-15 23:32:08 +02:00
|
|
|
function blah2(a /* single line multiple trailing comments */ /* second */) {
|
2014-08-15 22:18:54 +02:00
|
|
|
}
|
|
|
|
function blah3(a // trailing commen single line
|
|
|
|
) {
|
|
|
|
}
|
2014-08-16 00:49:09 +02:00
|
|
|
lambdaFoo = function (a, b) { return a * b; }; // This is trailing comment
|
|
|
|
/*leading comment*/ (
|
|
|
|
/*leading comment*/ function () { return 0; }); // Needs to be wrapped in parens to be a valid expression (not declaration)
|
|
|
|
/*leading comment*/ (function () { return 0; }); //trailing comment
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
//// [commentsFunction.d.ts]
|
2014-08-14 18:08:53 +02:00
|
|
|
/** This comment should appear for foo*/
|
2014-07-12 01:36:06 +02:00
|
|
|
declare function foo(): void;
|
2014-08-14 18:08:53 +02:00
|
|
|
/** This is comment for function signature*/
|
2014-08-15 23:21:41 +02:00
|
|
|
declare function fooWithParameters(/** this is comment about a*/ a: string,
|
|
|
|
/** this is comment for b*/
|
2014-08-14 18:38:22 +02:00
|
|
|
b: number): void;
|
2014-08-14 17:57:28 +02:00
|
|
|
/** fooFunc
|
|
|
|
* comment
|
|
|
|
*/
|
2014-07-12 01:36:06 +02:00
|
|
|
declare var fooFunc: (b: string) => string;
|
|
|
|
declare var lambdaFoo: (a: number, b: number) => number;
|
|
|
|
declare var lambddaNoVarComment: (a: number, b: number) => number;
|
2014-08-15 22:18:54 +02:00
|
|
|
declare function blah(a: string): void;
|
|
|
|
declare function blah2(a: string): void;
|
|
|
|
declare function blah3(a: string): void;
|