From 17cc20627175c702f217dd0d0281602c5ea4a32d Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Tue, 7 Jun 2016 16:22:18 -0700 Subject: [PATCH 1/4] Merge JSDoc of assignments from function expressions --- src/compiler/utilities.ts | 8 ++-- src/services/services.ts | 47 +++++++++++++------ tests/cases/fourslash/commentsFunction.ts | 34 ++++++++++++-- .../fourslash/getJavaScriptQuickInfo7.ts | 4 +- 4 files changed, 71 insertions(+), 22 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index d246b55556c8b..ee7887c1e86cf 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -603,9 +603,11 @@ namespace ts { } export function getJsDocCommentsFromText(node: Node, text: string) { - const commentRanges = (node.kind === SyntaxKind.Parameter || node.kind === SyntaxKind.TypeParameter) ? - concatenate(getTrailingCommentRanges(text, node.pos), - getLeadingCommentRanges(text, node.pos)) : + const commentRanges = (node.kind === SyntaxKind.Parameter || + node.kind === SyntaxKind.TypeParameter || + node.kind === SyntaxKind.FunctionExpression || + node.kind === SyntaxKind.ArrowFunction) ? + concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRangesOfNodeFromText(node, text); return filter(commentRanges, isJsDocComment); diff --git a/src/services/services.ts b/src/services/services.ts index 34b521b34961a..906ec2ae0d332 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -406,12 +406,11 @@ namespace ts { const sourceFileOfDeclaration = getSourceFileOfNode(declaration); // If it is parameter - try and get the jsDoc comment with @param tag from function declaration's jsDoc comments if (canUseParsedParamTagComments && declaration.kind === SyntaxKind.Parameter) { - ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), jsDocCommentTextRange => { - const cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); - if (cleanedParamJsDocComment) { - addRange(jsDocCommentParts, cleanedParamJsDocComment); - } - }); + if ((declaration.parent.kind === SyntaxKind.FunctionExpression || declaration.parent.kind === SyntaxKind.ArrowFunction) && + declaration.parent.parent.kind === SyntaxKind.VariableDeclaration) { + addCommentParts(declaration.parent.parent.parent, sourceFileOfDeclaration, getCleanedParamJsDocComment); + } + addCommentParts(declaration.parent, sourceFileOfDeclaration, getCleanedParamJsDocComment); } // If this is left side of dotted module declaration, there is no doc comments associated with this node @@ -419,24 +418,44 @@ namespace ts { return; } + if ((declaration.kind === SyntaxKind.FunctionExpression || declaration.kind === SyntaxKind.ArrowFunction) && + declaration.parent.kind === SyntaxKind.VariableDeclaration) { + addCommentParts(declaration.parent.parent, sourceFileOfDeclaration, getCleanedJsDocComment); + } + // If this is dotted module name, get the doc comments from the parent while (declaration.kind === SyntaxKind.ModuleDeclaration && declaration.parent.kind === SyntaxKind.ModuleDeclaration) { declaration = declaration.parent; } + addCommentParts(declaration.kind === SyntaxKind.VariableDeclaration ? declaration.parent.parent : declaration, + sourceFileOfDeclaration, + getCleanedJsDocComment); - // Get the cleaned js doc comment text from the declaration - ts.forEach(getJsDocCommentTextRange( - declaration.kind === SyntaxKind.VariableDeclaration ? declaration.parent.parent : declaration, sourceFileOfDeclaration), jsDocCommentTextRange => { - const cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); - if (cleanedJsDocComment) { - addRange(jsDocCommentParts, cleanedJsDocComment); - } - }); + if (declaration.kind === SyntaxKind.VariableDeclaration) { + const init = (declaration as VariableDeclaration).initializer; + if (init && (init.kind === SyntaxKind.FunctionExpression || init.kind === SyntaxKind.ArrowFunction)) { + // Get the cleaned js doc comment text from the initializer + addCommentParts(init, sourceFileOfDeclaration, getCleanedJsDocComment); + } + } } }); return jsDocCommentParts; + function addCommentParts(commented: Node, + sourceFileOfDeclaration: SourceFile, + getCommentPart: (pos: number, end: number, file: SourceFile) => SymbolDisplayPart[]): void { + const ranges = getJsDocCommentTextRange(commented, sourceFileOfDeclaration); + // Get the cleaned js doc comment text from the declaration + ts.forEach(ranges, jsDocCommentTextRange => { + const cleanedComment = getCommentPart(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); + if (cleanedComment) { + addRange(jsDocCommentParts, cleanedComment); + } + }); + } + function getJsDocCommentTextRange(node: Node, sourceFile: SourceFile): TextRange[] { return ts.map(getJsDocComments(node, sourceFile), jsDocComment => { diff --git a/tests/cases/fourslash/commentsFunction.ts b/tests/cases/fourslash/commentsFunction.ts index ac1e7f5effdd1..34d9e463eb670 100644 --- a/tests/cases/fourslash/commentsFunction.ts +++ b/tests/cases/fourslash/commentsFunction.ts @@ -33,6 +33,20 @@ //// } //// return lamb/*31*/daVar("World") + /*32*/a; ////} +/////** +//// * On variable +//// * @param s the first parameter! +//// * @returns the parameter's length +//// */ +////var assi/*33*/gned = /** +//// * Summary on expression +//// * @param s param on expression +//// * @returns return on expression +//// */function(/** On parameter */s: string) { +//// return s.length; +////} +////assig/*34*/ned/*35*/(/*36*/"hey"); + goTo.marker('1'); verify.currentSignatureHelpDocCommentIs("This comment should appear for foo"); @@ -68,14 +82,15 @@ verify.completionListContains('a', '(parameter) a: string', 'this is comment abo verify.completionListContains('b', '(parameter) b: number', 'this is comment for b'); goTo.marker('11'); -verify.quickInfoIs("var lambdaFoo: (a: number, b: number) => number", "lamdaFoo var comment"); +verify.quickInfoIs("var lambdaFoo: (a: number, b: number) => number", "lamdaFoo var comment\nthis is lambda comment"); goTo.marker('12'); -verify.quickInfoIs("var lambddaNoVarComment: (a: number, b: number) => number", ""); +// pick up doccomments from the lambda itself +verify.quickInfoIs("var lambddaNoVarComment: (a: number, b: number) => number", "this is lambda multiplication"); goTo.marker('13'); -verify.completionListContains('lambdaFoo', 'var lambdaFoo: (a: number, b: number) => number', ''); -verify.completionListContains('lambddaNoVarComment', 'var lambddaNoVarComment: (a: number, b: number) => number', ''); +verify.completionListContains('lambdaFoo', 'var lambdaFoo: (a: number, b: number) => number', 'lamdaFoo var comment\nthis is lambda comment'); +verify.completionListContains('lambddaNoVarComment', 'var lambddaNoVarComment: (a: number, b: number) => number', 'this is lambda multiplication'); goTo.marker('14'); verify.currentParameterHelpArgumentDocCommentIs("param a"); @@ -129,3 +144,14 @@ goTo.marker('31'); verify.quickInfoIs('(local var) lambdaVar: (b: string) => string', ''); goTo.marker('32'); verify.quickInfoIs('(parameter) a: number', ''); + +goTo.marker('33'); +verify.quickInfoIs("var assigned: (s: string) => number", "On variable\n@returns the parameter's length\nSummary on expression\n@returns return on expression"); +goTo.marker('34'); +verify.quickInfoIs("var assigned: (s: string) => number", "On variable\n@returns the parameter's length\nSummary on expression\n@returns return on expression"); +goTo.marker('35'); +verify.completionListContains("assigned", "var assigned: (s: string) => number", "On variable\n@returns the parameter's length\nSummary on expression\n@returns return on expression"); +goTo.marker('36'); +verify.currentSignatureHelpDocCommentIs("On variable\n@returns the parameter's length\nSummary on expression\n@returns return on expression"); +verify.currentParameterHelpArgumentDocCommentIs("param on expression\nthe first parameter!\nOn parameter "); + diff --git a/tests/cases/fourslash/getJavaScriptQuickInfo7.ts b/tests/cases/fourslash/getJavaScriptQuickInfo7.ts index 5aa8474757d50..7b8d967d19070 100644 --- a/tests/cases/fourslash/getJavaScriptQuickInfo7.ts +++ b/tests/cases/fourslash/getJavaScriptQuickInfo7.ts @@ -17,4 +17,6 @@ //// x - /**/a1() goTo.marker(); -verify.quickInfoExists(); \ No newline at end of file +verify.quickInfoExists(); +verify.quickInfoIs('function a1(p: any): number', + 'This is a very cool function that is very nice.\n@returns something'); From 6bf5f115b639b74e6700f8d042753a6e94a884f8 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 8 Jun 2016 08:42:38 -0700 Subject: [PATCH 2/4] Improve order of parameter's merged jsdoc --- tests/cases/fourslash/commentsFunction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cases/fourslash/commentsFunction.ts b/tests/cases/fourslash/commentsFunction.ts index 34d9e463eb670..2dff7c357a61c 100644 --- a/tests/cases/fourslash/commentsFunction.ts +++ b/tests/cases/fourslash/commentsFunction.ts @@ -153,5 +153,5 @@ goTo.marker('35'); verify.completionListContains("assigned", "var assigned: (s: string) => number", "On variable\n@returns the parameter's length\nSummary on expression\n@returns return on expression"); goTo.marker('36'); verify.currentSignatureHelpDocCommentIs("On variable\n@returns the parameter's length\nSummary on expression\n@returns return on expression"); -verify.currentParameterHelpArgumentDocCommentIs("param on expression\nthe first parameter!\nOn parameter "); +verify.currentParameterHelpArgumentDocCommentIs("the first parameter!\nparam on expression\nOn parameter "); From 9832f62f48b0d6da4af72efc6ba10160b37e0442 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 8 Jun 2016 10:56:52 -0700 Subject: [PATCH 3/4] Split commentsFunction test into expr/decl And renumber. --- tests/cases/fourslash/commentsFunction.ts | 157 ------------------ .../fourslash/commentsFunctionDeclaration.ts | 61 +++++++ .../fourslash/commentsFunctionExpression.ts | 91 ++++++++++ 3 files changed, 152 insertions(+), 157 deletions(-) delete mode 100644 tests/cases/fourslash/commentsFunction.ts create mode 100644 tests/cases/fourslash/commentsFunctionDeclaration.ts create mode 100644 tests/cases/fourslash/commentsFunctionExpression.ts diff --git a/tests/cases/fourslash/commentsFunction.ts b/tests/cases/fourslash/commentsFunction.ts deleted file mode 100644 index 2dff7c357a61c..0000000000000 --- a/tests/cases/fourslash/commentsFunction.ts +++ /dev/null @@ -1,157 +0,0 @@ -/// - -/////** This comment should appear for foo*/ -////function f/*6*/oo() { -////} -////f/*7*/oo/*4*/(/*1*/); -/////** This is comment for function signature*/ -////function fo/*8*/oWithParameters(/** this is comment about a*/a: string, -//// /** this is comment for b*/ -//// b: number) { -//// var /*20*/d = /*10*/a; -////} -////fooWithParam/*9*/eters/*5*/(/*2*/"a",/*3*/10); -/////** lamdaFoo var comment*/ -////var lamb/*11*/daFoo = /** this is lambda comment*/ (/**param a*/a: number, /**param b*/b: number) => /*18*/a + b; -////var lambddaN/*12*/oVarComment = /** this is lambda multiplication*/ (/**param a*/a: number, /**param b*/b: number) => a * b; -/////*13*/lambdaFoo(/*14*/10, /*15*/20); -////lambddaNoVarComment(/*16*/10, /*17*/20); -/////** -////* Does something -////* @param a a string -////*/ -////declare function fn(a: string); -////fn(/*19*/"hello"); -////var lambdaA/*20a*/notherFunc = (/*21*/a: number) => { -//// var bb/*22*/bb = 10; -//// return /*24*/a + b/*23*/bbb; -////} -////function /*25*/anotherFunc(/*26*/a: number) { -//// var /*27a*/lambdaVar = (/*27*/b: string) => { -//// var /*28*/localVar = "Hello "; -//// return /*29*/localVar + /*30*/b; -//// } -//// return lamb/*31*/daVar("World") + /*32*/a; -////} -/////** -//// * On variable -//// * @param s the first parameter! -//// * @returns the parameter's length -//// */ -////var assi/*33*/gned = /** -//// * Summary on expression -//// * @param s param on expression -//// * @returns return on expression -//// */function(/** On parameter */s: string) { -//// return s.length; -////} -////assig/*34*/ned/*35*/(/*36*/"hey"); - - -goTo.marker('1'); -verify.currentSignatureHelpDocCommentIs("This comment should appear for foo"); - -goTo.marker('2'); -verify.currentSignatureHelpDocCommentIs("This is comment for function signature"); -verify.currentParameterHelpArgumentDocCommentIs("this is comment about a"); - -goTo.marker('3'); -verify.currentSignatureHelpDocCommentIs("This is comment for function signature"); -verify.currentParameterHelpArgumentDocCommentIs("this is comment for b"); - -goTo.marker('4'); -verify.completionListContains('foo', 'function foo(): void', 'This comment should appear for foo'); - -goTo.marker('5'); -verify.completionListContains('fooWithParameters', 'function fooWithParameters(a: string, b: number): void', 'This is comment for function signature'); - -goTo.marker('6'); -verify.quickInfoIs("function foo(): void", "This comment should appear for foo"); - -goTo.marker('7'); -verify.quickInfoIs("function foo(): void", "This comment should appear for foo"); - -goTo.marker('8'); -verify.quickInfoIs("function fooWithParameters(a: string, b: number): void", "This is comment for function signature"); - -goTo.marker('9'); -verify.quickInfoIs("function fooWithParameters(a: string, b: number): void", "This is comment for function signature"); - -goTo.marker('10'); -verify.completionListContains('a', '(parameter) a: string', 'this is comment about a'); -verify.completionListContains('b', '(parameter) b: number', 'this is comment for b'); - -goTo.marker('11'); -verify.quickInfoIs("var lambdaFoo: (a: number, b: number) => number", "lamdaFoo var comment\nthis is lambda comment"); - -goTo.marker('12'); -// pick up doccomments from the lambda itself -verify.quickInfoIs("var lambddaNoVarComment: (a: number, b: number) => number", "this is lambda multiplication"); - -goTo.marker('13'); -verify.completionListContains('lambdaFoo', 'var lambdaFoo: (a: number, b: number) => number', 'lamdaFoo var comment\nthis is lambda comment'); -verify.completionListContains('lambddaNoVarComment', 'var lambddaNoVarComment: (a: number, b: number) => number', 'this is lambda multiplication'); - -goTo.marker('14'); -verify.currentParameterHelpArgumentDocCommentIs("param a"); - -goTo.marker('15'); -verify.currentParameterHelpArgumentDocCommentIs("param b"); - -goTo.marker('16'); -verify.currentParameterHelpArgumentDocCommentIs("param a"); - -goTo.marker('17'); -verify.currentParameterHelpArgumentDocCommentIs("param b"); - -goTo.marker('18'); -verify.completionListContains('a', '(parameter) a: number', 'param a'); -verify.completionListContains('b', '(parameter) b: number', 'param b'); - -goTo.marker('19'); -verify.currentSignatureHelpDocCommentIs("Does something"); -verify.currentParameterHelpArgumentDocCommentIs("a string"); - -goTo.marker('20'); -verify.quickInfoIs('(local var) d: string', ''); - -goTo.marker('20a'); -verify.quickInfoIs('var lambdaAnotherFunc: (a: number) => number', ''); -goTo.marker('21'); -verify.quickInfoIs('(parameter) a: number', ''); -goTo.marker('22'); -verify.quickInfoIs('(local var) bbbb: number', ''); -goTo.marker('23'); -verify.quickInfoIs('(local var) bbbb: number', ''); -goTo.marker('24'); -verify.quickInfoIs('(parameter) a: number', ''); - -goTo.marker('25'); -verify.quickInfoIs('function anotherFunc(a: number): string', ''); -goTo.marker('26'); -verify.quickInfoIs('(parameter) a: number', ''); -goTo.marker('27a'); -verify.quickInfoIs('(local var) lambdaVar: (b: string) => string', ''); -goTo.marker('27'); -verify.quickInfoIs('(parameter) b: string', ''); -goTo.marker('28'); -verify.quickInfoIs('(local var) localVar: string', ''); -goTo.marker('29'); -verify.quickInfoIs('(local var) localVar: string', ''); -goTo.marker('30'); -verify.quickInfoIs('(parameter) b: string', ''); -goTo.marker('31'); -verify.quickInfoIs('(local var) lambdaVar: (b: string) => string', ''); -goTo.marker('32'); -verify.quickInfoIs('(parameter) a: number', ''); - -goTo.marker('33'); -verify.quickInfoIs("var assigned: (s: string) => number", "On variable\n@returns the parameter's length\nSummary on expression\n@returns return on expression"); -goTo.marker('34'); -verify.quickInfoIs("var assigned: (s: string) => number", "On variable\n@returns the parameter's length\nSummary on expression\n@returns return on expression"); -goTo.marker('35'); -verify.completionListContains("assigned", "var assigned: (s: string) => number", "On variable\n@returns the parameter's length\nSummary on expression\n@returns return on expression"); -goTo.marker('36'); -verify.currentSignatureHelpDocCommentIs("On variable\n@returns the parameter's length\nSummary on expression\n@returns return on expression"); -verify.currentParameterHelpArgumentDocCommentIs("the first parameter!\nparam on expression\nOn parameter "); - diff --git a/tests/cases/fourslash/commentsFunctionDeclaration.ts b/tests/cases/fourslash/commentsFunctionDeclaration.ts new file mode 100644 index 0000000000000..892cbf9076040 --- /dev/null +++ b/tests/cases/fourslash/commentsFunctionDeclaration.ts @@ -0,0 +1,61 @@ +/// + +/////** 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"); + +goTo.marker('1'); +verify.quickInfoIs("function foo(): void", "This comment should appear for foo"); + +goTo.marker('2'); +verify.quickInfoIs("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"); + +goTo.marker('5'); +verify.quickInfoIs("function fooWithParameters(a: string, b: number): void", "This is comment for function signature"); + +goTo.marker('6'); +verify.quickInfoIs('(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'); + +goTo.marker('8'); +verify.quickInfoIs("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"); diff --git a/tests/cases/fourslash/commentsFunctionExpression.ts b/tests/cases/fourslash/commentsFunctionExpression.ts new file mode 100644 index 0000000000000..ace3b07d45510 --- /dev/null +++ b/tests/cases/fourslash/commentsFunctionExpression.ts @@ -0,0 +1,91 @@ +/// +// TODO: Salsa test! With types! +// TODO: Renumber!!!! +// TODO:Remove some duplicate tests + +// test arrow doc comments +/////** lamdaFoo var comment*/ +////var lamb/*1*/daFoo = /** this is lambda comment*/ (/**param a*/a: number, /**param b*/b: number) => /*2*/a + b; +////var lambddaN/*3*/oVarComment = /** this is lambda multiplication*/ (/**param a*/a: number, /**param b*/b: number) => a * b; +/////*4*/lambdaFoo(/*5*/10, /*6*/20); + +// test nested arrow doc comments +////function /*7*/anotherFunc(a: number) { +//// /** documentation +//// @param b {string} inner parameter */ +//// var /*8*/lambdaVar = /** inner docs */(/*9*/b: string) => { +//// var /*10*/localVar = "Hello "; +//// return /*11*/localVar + /*12*/b; +//// } +//// return lamb/*13*/daVar("World") + a; +////} + +// test function expression doc comments +/////** +//// * On variable +//// * @param s the first parameter! +//// * @returns the parameter's length +//// */ +////var assi/*14*/gned = /** +//// * Summary on expression +//// * @param s param on expression +//// * @returns return on expression +//// */function(/** On parameter */s: string) { +//// return /*15*/s.length; +////} +////assig/*16*/ned/*17*/(/*18*/"hey"); + + + +goTo.marker('1'); +verify.quickInfoIs("var lambdaFoo: (a: number, b: number) => number", "lamdaFoo var comment\nthis is lambda comment"); + +goTo.marker('2'); +verify.completionListContains('a', '(parameter) a: number', 'param a'); +verify.completionListContains('b', '(parameter) b: number', 'param b'); + +goTo.marker('3'); +// pick up doccomments from the lambda itself +verify.quickInfoIs("var lambddaNoVarComment: (a: number, b: number) => number", "this is lambda multiplication"); + +goTo.marker('4'); +verify.completionListContains('lambdaFoo', 'var lambdaFoo: (a: number, b: number) => number', 'lamdaFoo var comment\nthis is lambda comment'); +verify.completionListContains('lambddaNoVarComment', 'var lambddaNoVarComment: (a: number, b: number) => number', 'this is lambda multiplication'); + +goTo.marker('5'); +verify.currentParameterHelpArgumentDocCommentIs("param a"); + +goTo.marker('6'); +verify.currentParameterHelpArgumentDocCommentIs("param b"); + + + + +goTo.marker('7'); +// no documentation from nested lambda +verify.quickInfoIs('function anotherFunc(a: number): string', ''); +goTo.marker('8'); +verify.quickInfoIs('(local var) lambdaVar: (b: string) => string', 'documentation\ninner docs '); +goTo.marker('9'); +verify.quickInfoIs('(parameter) b: string', '{string} inner parameter '); +goTo.marker('10'); +verify.quickInfoIs('(local var) localVar: string', ''); +goTo.marker('11'); +verify.quickInfoIs('(local var) localVar: string', ''); +goTo.marker('12'); +verify.quickInfoIs('(parameter) b: string', '{string} inner parameter '); +goTo.marker('13'); +verify.quickInfoIs('(local var) lambdaVar: (b: string) => string', 'documentation\ninner docs '); + +goTo.marker('14'); +verify.quickInfoIs("var assigned: (s: string) => number", "On variable\n@returns the parameter's length\nSummary on expression\n@returns return on expression"); +goTo.marker('15'); +verify.completionListContains('s', '(parameter) s: string', "the first parameter!\nparam on expression\nOn parameter "); +goTo.marker('16'); +verify.quickInfoIs("var assigned: (s: string) => number", "On variable\n@returns the parameter's length\nSummary on expression\n@returns return on expression"); +goTo.marker('17'); +verify.completionListContains("assigned", "var assigned: (s: string) => number", "On variable\n@returns the parameter's length\nSummary on expression\n@returns return on expression"); +goTo.marker('18'); +verify.currentSignatureHelpDocCommentIs("On variable\n@returns the parameter's length\nSummary on expression\n@returns return on expression"); +verify.currentParameterHelpArgumentDocCommentIs("the first parameter!\nparam on expression\nOn parameter "); + From 1fe6626efa3d2bf6e2a0060d5560d07161489f0d Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 8 Jun 2016 11:07:42 -0700 Subject: [PATCH 4/4] Remove TODO comments --- tests/cases/fourslash/commentsFunctionExpression.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/cases/fourslash/commentsFunctionExpression.ts b/tests/cases/fourslash/commentsFunctionExpression.ts index ace3b07d45510..048efa3c9c186 100644 --- a/tests/cases/fourslash/commentsFunctionExpression.ts +++ b/tests/cases/fourslash/commentsFunctionExpression.ts @@ -1,7 +1,4 @@ /// -// TODO: Salsa test! With types! -// TODO: Renumber!!!! -// TODO:Remove some duplicate tests // test arrow doc comments /////** lamdaFoo var comment*/