2014-07-13 01:04:16 +02:00
/// <reference path='fourslash.ts' />
/////// This is simple /// comments
////function simple() {
////}
////
////sim/*1q*/ple( /*1*/);
////
/////// multiLine /// Comments
/////// This is example of multiline /// comments
/////// Another multiLine
////function multiLine() {
////}
////mul/*2q*/tiLine( /*2*/);
////
/////** this is eg of single line jsdoc style comment */
////function jsDocSingleLine() {
////}
////jsDoc/*3q*/SingleLine(/*3*/);
////
////
/////** this is multiple line jsdoc stule comment
////*New line1
////*New Line2*/
////function jsDocMultiLine() {
////}
////jsDocM/*4q*/ultiLine(/*4*/);
////
2019-06-29 17:05:10 +02:00
/////** multiple line jsdoc comments no longer merge
2014-07-13 01:04:16 +02:00
////*New line1
////*New Line2*/
/////** Shoul mege this line as well
////* and this too*/ /** Another this one too*/
////function jsDocMultiLineMerge() {
////}
////jsDocMu/*5q*/ltiLineMerge(/*5*/);
////
////
/////// Triple slash comment
/////** jsdoc comment */
////function jsDocMixedComments1() {
////}
////jsDocMix/*6q*/edComments1(/*6*/);
////
/////// Triple slash comment
2014-09-11 22:21:27 +02:00
/////** jsdoc comment */ /** another jsDocComment*/
2014-07-13 01:04:16 +02:00
////function jsDocMixedComments2() {
////}
////jsDocMi/*7q*/xedComments2(/*7*/);
////
2018-03-16 06:23:10 +01:00
/////** jsdoc comment */ /*** triplestar jsDocComment*/
2014-07-13 01:04:16 +02:00
/////// Triple slash comment
////function jsDocMixedComments3() {
////}
////jsDocMixe/*8q*/dComments3(/*8*/);
////
2014-09-11 22:21:27 +02:00
/////** jsdoc comment */ /** another jsDocComment*/
2014-07-13 01:04:16 +02:00
/////// Triple slash comment
/////// Triple slash comment 2
////function jsDocMixedComments4() {
////}
////jsDocMixed/*9q*/Comments4(/*9*/);
////
/////// Triple slash comment 1
2014-09-11 22:21:27 +02:00
/////** jsdoc comment */ /** another jsDocComment*/
2014-07-13 01:04:16 +02:00
/////// Triple slash comment
/////// Triple slash comment 2
////function jsDocMixedComments5() {
////}
////jsDocM/*10q*/ixedComments5(/*10*/);
////
2014-09-11 22:21:27 +02:00
/////** another jsDocComment*/
2014-07-13 01:04:16 +02:00
/////// Triple slash comment 1
/////// Triple slash comment
/////// Triple slash comment 2
/////** jsdoc comment */
////function jsDocMixedComments6() {
////}
////jsDocMix/*11q*/edComments6(/*11*/);
////
////// This shoulnot be help comment
////function noHelpComment1() {
////}
////noHel/*12q*/pComment1(/*12*/);
////
/////* This shoulnot be help comment */
////function noHelpComment2() {
////}
////noHelpC/*13q*/omment2(/*13*/);
////
////function noHelpComment3() {
////}
////noHelpC/*14q*/omment3(/*14*/);
/////** Adds two integers and returns the result
//// * @param {number} a first number
//// * @param b second number
//// */
2014-09-11 22:21:27 +02:00
////function sum(/*16aq*/a: number, /*17aq*/b: number) {
2014-07-13 01:04:16 +02:00
//// return /*18*/a + b;
////}
/////*15*/s/*16q*/um(/*16*/10, /*17*/20);
2019-06-29 17:05:10 +02:00
/////** This is multiplication function
//// * @param
//// * @param a first number
//// * @param b
//// * @param c {
//// @param d @anotherTag
//// * @param e LastParam @anotherTag*/
2014-09-11 22:21:27 +02:00
////function multiply(/*19aq*/a: number, /*20aq*/b: number, /*21aq*/c?: number, /*22aq*/d?, /*23aq*/e?) {
2014-07-13 01:04:16 +02:00
////}
////mult/*19q*/iply(/*19*/10,/*20*/ 20,/*21*/ 30, /*22*/40, /*23*/50);
/////** fn f1 with number
////* @param { string} b about b
////*/
2014-09-11 22:21:27 +02:00
////function f1(/*25aq*/a: number);
////function f1(/*26aq*/b: string);
2014-07-13 01:04:16 +02:00
/////**@param opt optional parameter*/
////function f1(aOrb, opt?) {
//// return /*24*/aOrb;
////}
////f/*25q*/1(/*25*/10);
////f/*26q*/1(/*26*/"hello");
/////*27*/
/////** This is subtract function
////@param { a
////*@param { number | } b this is about b
////@param { { () => string; } } c this is optional param c
////@param { { () => string; } d this is optional param d
////@param { { () => string; } } e this is optional param e
////@param { { { () => string; } } f this is optional param f
////*/
2014-09-11 22:21:27 +02:00
////function subtract(/*28aq*/a: number, /*29aq*/b: number, /*30aq*/c?: () => string, /*31aq*/d?: () => string, /*32aq*/e?: () => string, /*33aq*/f?: () => string) {
2014-07-13 01:04:16 +02:00
////}
////subt/*28q*/ract(/*28*/10, /*29*/ 20, /*30*/ null, /*31*/ null, /*32*/ null, /*33*/null);
/////** this is square function
////@paramTag { number } a this is input number of paramTag
////@param { number } a this is input number
////@returnType { number } it is return type
////*/
2014-09-11 22:21:27 +02:00
////function square(/*34aq*/a: number) {
2014-07-13 01:04:16 +02:00
//// return a * a;
////}
////squ/*34q*/are(/*34*/10);
/////** this is divide function
////@param { number} a this is a
////@paramTag { number } g this is optional param g
////@param { number} b this is b
////*/
2014-09-11 22:21:27 +02:00
////function divide(/*35aq*/a: number, /*36aq*/b: number) {
2014-07-13 01:04:16 +02:00
////}
////div/*35q*/ide(/*35*/10, /*36*/20);
/////**
////Function returns string concat of foo and bar
////@param {string} foo is string
////@param {string} bar is second string
////*/
2014-09-11 22:21:27 +02:00
////function fooBar(/*37aq*/foo: string, /*38aq*/bar: string) {
2014-07-13 01:04:16 +02:00
//// return foo + bar;
////}
////fo/*37q*/oBar(/*37*/"foo",/*38*/"bar");
/////** This is a comment */
////var x;
2017-06-07 21:28:52 +02:00
/////**
//// * This is a comment
2014-07-13 01:04:16 +02:00
//// */
////var y;
/////** this is jsdoc style function with param tag as well as inline parameter help
////*@param a it is first parameter
////*@param c it is third parameter
////*/
2014-09-11 22:21:27 +02:00
////function jsDocParamTest(/** this is inline comment for a *//*40aq*/a: number, /** this is inline comment for b*/ /*41aq*/b: number, /*42aq*/c: number, /*43aq*/d: number) {
2014-07-13 01:04:16 +02:00
//// return /*39*/a + b + c + d;
////}
/////*44*/jsD/*40q*/ocParamTest(/*40*/30, /*41*/40, /*42*/50, /*43*/60);
/////** This is function comment
2017-06-07 21:28:52 +02:00
//// * And properly aligned comment
2014-07-13 01:04:16 +02:00
//// */
////function jsDocCommentAlignmentTest1() {
////}
////jsDocCom/*45q*/mentAlignmentTest1(/*45*/);
/////** This is function comment
//// * And aligned with 4 space char margin
//// */
////function jsDocCommentAlignmentTest2() {
////}
////jsDocComme/*46q*/ntAlignmentTest2(/*46*/);
/////** This is function comment
//// * And aligned with 4 space char margin
//// * @param {string} a this is info about a
//// * spanning on two lines and aligned perfectly
//// * @param b this is info about b
//// * spanning on two lines and aligned perfectly
//// * spanning one more line alined perfectly
//// * spanning another line with more margin
//// * @param c this is info about b
//// * not aligned text about parameter will eat only one space
//// */
2014-09-11 22:21:27 +02:00
////function jsDocCommentAlignmentTest3(/*47aq*/a: string, /*48aq*/b, /*49aq*/c) {
2014-07-13 01:04:16 +02:00
////}
////jsDocComme/*47q*/ntAlignmentTest3(/*47*/"hello",/*48*/1, /*49*/2);
/////**/
////class NoQuic/*50*/kInfoClass {
////}
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "1" , docComment : "" } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "1q" , "function simple(): void" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "2" , docComment : "" } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "2q" , "function multiLine(): void" ) ;
2014-07-13 01:04:16 +02:00
2018-07-28 01:28:49 +02:00
verify . signatureHelp ( { marker : "3" , docComment : "this is eg of single line jsdoc style comment" } ) ;
verify . quickInfoAt ( "3q" , "function jsDocSingleLine(): void" , "this is eg of single line jsdoc style comment" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "4" , docComment : "this is multiple line jsdoc stule comment\nNew line1\nNew Line2" } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "4q" , "function jsDocMultiLine(): void" , "this is multiple line jsdoc stule comment\nNew line1\nNew Line2" ) ;
2014-07-13 01:04:16 +02:00
2019-06-29 17:05:10 +02:00
verify . signatureHelp ( { marker : "5" , docComment : "Another this one too" } ) ;
verify . quickInfoAt ( "5q" , "function jsDocMultiLineMerge(): void" , "Another this one too" ) ;
2014-07-13 01:04:16 +02:00
2018-07-28 01:28:49 +02:00
verify . signatureHelp ( { marker : "6" , docComment : "jsdoc comment" } ) ;
verify . quickInfoAt ( "6q" , "function jsDocMixedComments1(): void" , "jsdoc comment" ) ;
2014-07-13 01:04:16 +02:00
2019-06-29 17:05:10 +02:00
verify . signatureHelp ( { marker : "7" , docComment : "another jsDocComment" } ) ;
verify . quickInfoAt ( "7q" , "function jsDocMixedComments2(): void" , "another jsDocComment" ) ;
2014-07-13 01:04:16 +02:00
2019-06-29 17:05:10 +02:00
verify . signatureHelp ( { marker : "8" , docComment : "* triplestar jsDocComment" } ) ;
verify . quickInfoAt ( "8q" , "function jsDocMixedComments3(): void" , "* triplestar jsDocComment" ) ;
2014-07-13 01:04:16 +02:00
2019-06-29 17:05:10 +02:00
verify . signatureHelp ( { marker : "9" , docComment : "another jsDocComment" } ) ;
verify . quickInfoAt ( "9q" , "function jsDocMixedComments4(): void" , "another jsDocComment" ) ;
2014-07-13 01:04:16 +02:00
2019-06-29 17:05:10 +02:00
verify . signatureHelp ( { marker : "10" , docComment : "another jsDocComment" } ) ;
verify . quickInfoAt ( "10q" , "function jsDocMixedComments5(): void" , "another jsDocComment" ) ;
2014-07-13 01:04:16 +02:00
2019-06-29 17:05:10 +02:00
verify . signatureHelp ( { marker : "11" , docComment : "jsdoc comment" } ) ;
verify . quickInfoAt ( "11q" , "function jsDocMixedComments6(): void" , "jsdoc comment" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "12" , docComment : "" } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "12q" , "function noHelpComment1(): void" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "13" , docComment : "" } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "13q" , "function noHelpComment2(): void" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "14" , docComment : "" } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "14q" , "function noHelpComment3(): void" ) ;
2014-07-13 01:04:16 +02:00
2018-09-13 17:47:50 +02:00
verify . completions ( {
marker : "15" ,
includes : {
name : "sum" ,
text : "function sum(a: number, b: number): number" ,
documentation : "Adds two integers and returns the result" ,
tags : [
{ name : "param" , text : "a first number" } ,
{ name : "param" , text : "b second number" } ,
] ,
} ,
} ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
const addTags : ReadonlyArray < FourSlashInterface.JSDocTagInfo > = [
{ name : "param" , text : "a first number" } ,
{ name : "param" , text : "b second number" } ,
] ;
verify . signatureHelp ( {
marker : "16" ,
docComment : "Adds two integers and returns the result" ,
parameterDocComment : "first number" ,
tags : addTags ,
} ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfos ( {
"16q" : [ "function sum(a: number, b: number): number" , "Adds two integers and returns the result" ] ,
"16aq" : [ "(parameter) a: number" , "first number" ]
} ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( {
marker : "17" ,
docComment : "Adds two integers and returns the result" ,
parameterDocComment : "second number" ,
tags : addTags ,
} ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "17aq" , "(parameter) b: number" , "second number" ) ;
2014-07-13 01:04:16 +02:00
2018-10-29 18:03:25 +01:00
verify . completions ( {
marker : "18" ,
includes : [
{ name : "a" , text : "(parameter) a: number" , documentation : "first number" , tags : [ { name : "param" , text : "a first number" } ] } ,
{ name : "b" , text : "(parameter) b: number" , documentation : "second number" , tags : [ { name : "param" , text : "b second number" } ] } ,
] ,
} ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
const multiplyTags : ReadonlyArray < FourSlashInterface.JSDocTagInfo > = [
{ name : "param" , text : "" } ,
{ name : "param" , text : "a first number" } ,
{ name : "param" , text : "b" } ,
{ name : "param" , text : "c" } ,
{ name : "param" , text : "d" } ,
{ name : "anotherTag" , text : undefined } ,
2018-07-28 01:28:49 +02:00
{ name : "param" , text : "e LastParam" } ,
2018-05-15 21:34:53 +02:00
{ name : "anotherTag" , text : undefined } ,
] ;
verify . signatureHelp ( { marker : "19" , docComment : "This is multiplication function" , parameterDocComment : "first number" , tags : multiplyTags } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfos ( {
"19q" : [
"function multiply(a: number, b: number, c?: number, d?: any, e?: any): void" ,
2016-09-15 20:53:04 +02:00
"This is multiplication function"
2016-09-09 18:02:55 +02:00
] ,
"19aq" : [ "(parameter) a: number" , "first number" ]
} ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "20" , docComment : "This is multiplication function" , tags : multiplyTags } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "20aq" , "(parameter) b: number" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "21" , docComment : "This is multiplication function" , tags : multiplyTags } ) ;
2016-09-15 20:53:04 +02:00
verify . quickInfoAt ( "21aq" , "(parameter) c: number" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "22" , docComment : "This is multiplication function" , tags : multiplyTags } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "22aq" , "(parameter) d: any" ) ;
2014-07-13 01:04:16 +02:00
2018-07-28 01:28:49 +02:00
verify . signatureHelp ( { marker : "23" , docComment : "This is multiplication function" , parameterDocComment : "LastParam" , tags : multiplyTags } ) ;
verify . quickInfoAt ( "23aq" , "(parameter) e: any" , "LastParam" ) ;
2014-07-13 01:04:16 +02:00
2018-10-29 18:03:25 +01:00
verify . completions ( {
marker : "24" ,
includes : [
{ name : "aOrb" , text : "(parameter) aOrb: any" } ,
{
name : "opt" ,
text : "(parameter) opt: any" ,
documentation : "optional parameter" ,
tags : [ { name : "param" , text : "opt optional parameter" } ] ,
} ,
]
} ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( {
marker : "25" ,
overloadsCount : 2 ,
docComment : "fn f1 with number" ,
tags : [ { name : "param" , text : "b about b" } ] ,
} ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfos ( {
"25q" : [ "function f1(a: number): any (+1 overload)" , "fn f1 with number" ] ,
"25aq" : "(parameter) a: number"
} ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "26" , overloadsCount : 2 , docComment : "" } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfos ( {
2018-08-27 18:38:52 +02:00
"26q" : [ "function f1(b: string): any (+1 overload)" , "fn f1 with number" ] ,
2016-09-09 18:02:55 +02:00
"26aq" : "(parameter) b: string"
} ) ;
2014-07-13 01:04:16 +02:00
2018-10-29 18:03:25 +01:00
verify . completions ( {
marker : "27" ,
includes : [
{
name : "multiply" ,
text : "function multiply(a: number, b: number, c?: number, d?: any, e?: any): void" ,
documentation : "This is multiplication function" ,
tags : [
{ name : "param" , text : "" } ,
{ name : "param" , text : "a first number" } ,
{ name : "param" , text : "b" } ,
{ name : "param" , text : "c" } ,
{ name : "param" , text : "d" } ,
{ name : "anotherTag" , text : undefined } ,
{ name : "param" , text : "e LastParam" } ,
{ name : "anotherTag" , text : undefined } ,
] ,
} ,
{
name : "f1" ,
text : "function f1(a: number): any (+1 overload)" ,
documentation : "fn f1 with number" ,
tags : [ { name : "param" , text : "b about b" } ] ,
} ,
] ,
} ) ;
2014-07-13 01:04:16 +02:00
2017-06-07 21:28:52 +02:00
const subtractDoc = "This is subtract function" ;
2018-05-15 21:34:53 +02:00
const subtractTags : ReadonlyArray < FourSlashInterface.JSDocTagInfo > = [
{ name : "param" , text : "" } ,
{ name : "param" , text : "b this is about b" } ,
{ name : "param" , text : "c this is optional param c" } ,
{ name : "param" , text : "d this is optional param d" } ,
{ name : "param" , text : "e this is optional param e" } ,
{ name : "param" , text : " { () => string; } } f this is optional param f" } ,
] ;
verify . signatureHelp ( { marker : "28" , docComment : subtractDoc , tags : subtractTags } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfos ( {
"28q" : [
"function subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void" ,
2017-06-07 21:28:52 +02:00
subtractDoc ,
2016-09-09 18:02:55 +02:00
] ,
"28aq" : "(parameter) a: number"
} ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "29" , docComment : subtractDoc , tags : subtractTags , parameterDocComment : "this is about b" } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "29aq" , "(parameter) b: number" , "this is about b" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "30" , docComment : subtractDoc , tags : subtractTags , parameterDocComment : "this is optional param c" } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "30aq" , "(parameter) c: () => string" , "this is optional param c" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "31" , docComment : subtractDoc , tags : subtractTags , parameterDocComment : "this is optional param d" } ) ;
2016-09-15 20:53:04 +02:00
verify . quickInfoAt ( "31aq" , "(parameter) d: () => string" , "this is optional param d" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "32" , docComment : subtractDoc , tags : subtractTags , parameterDocComment : "this is optional param e" } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "32aq" , "(parameter) e: () => string" , "this is optional param e" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "33" , docComment : subtractDoc , tags : subtractTags } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "33aq" , "(parameter) f: () => string" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( {
marker : "34" ,
docComment : "this is square function" ,
parameterDocComment : "this is input number" ,
tags : [
{ name : "paramTag" , text : "{ number } a this is input number of paramTag" } ,
{ name : "param" , text : "a this is input number" } ,
{ name : "returnType" , text : "{ number } it is return type" } ,
] ,
} ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfos ( {
"34q" : [
"function square(a: number): number" ,
2016-09-15 20:53:04 +02:00
"this is square function"
2016-09-09 18:02:55 +02:00
] ,
"34aq" : [
"(parameter) a: number" ,
"this is input number"
]
} ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
const divideTags : ReadonlyArray < FourSlashInterface.JSDocTagInfo > = [
{ name : "param" , text : "a this is a" } ,
{ name : "paramTag" , text : "{ number } g this is optional param g" } ,
{ name : "param" , text : "b this is b" } ,
] ;
verify . signatureHelp ( { marker : "35" , docComment : "this is divide function" , parameterDocComment : "this is a" , tags : divideTags } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfos ( {
"35q" : [
"function divide(a: number, b: number): void" ,
2016-09-15 20:53:04 +02:00
"this is divide function"
2016-09-09 18:02:55 +02:00
] ,
"35aq" : [
"(parameter) a: number" ,
"this is a"
]
} ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "36" , docComment : "this is divide function" , parameterDocComment : "this is b" , tags : divideTags } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "36aq" , "(parameter) b: number" , "this is b" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
const concatDoc = "Function returns string concat of foo and bar" ;
const concatTags : ReadonlyArray < FourSlashInterface.JSDocTagInfo > = [
{ name : "param" , text : "foo is string" } ,
{ name : "param" , text : "bar is second string" } ,
] ;
verify . signatureHelp ( { marker : "37" , docComment : concatDoc , parameterDocComment : "is string" , tags : concatTags } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfos ( {
2018-05-15 21:34:53 +02:00
"37q" : [ "function fooBar(foo: string, bar: string): string" , concatDoc ] ,
2016-09-09 18:02:55 +02:00
"37aq" : [ "(parameter) foo: string" , "is string" ]
} ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "38" , docComment : concatDoc , parameterDocComment : "is second string" , tags : concatTags } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "38aq" , "(parameter) bar: string" , "is second string" ) ;
2014-07-13 01:04:16 +02:00
2018-10-29 18:03:25 +01:00
verify . completions ( {
marker : "39" ,
includes : [
{
name : "a" ,
text : "(parameter) a: number" ,
documentation : "this is inline comment for a\nit is first parameter" ,
tags : [ { name : "param" , text : "a it is first parameter" } ] ,
} ,
{ name : "b" , text : "(parameter) b: number" , documentation : "this is inline comment for b" } ,
{
name : "c" ,
text : "(parameter) c: number" ,
documentation : "it is third parameter" ,
tags : [ { name : "param" , text : "c it is third parameter" } ] ,
} ,
{ name : "d" , text : "(parameter) d: number" } ,
] ,
} ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
const jsdocTestDocComment = "this is jsdoc style function with param tag as well as inline parameter help" ;
const jsdocTestTags : ReadonlyArray < FourSlashInterface.JSDocTagInfo > = [
{ name : "param" , text : "a it is first parameter" } ,
{ name : "param" , text : "c it is third parameter" } ,
] ;
2018-07-28 01:28:49 +02:00
verify . signatureHelp ( { marker : "40" , docComment : jsdocTestDocComment , parameterDocComment : "this is inline comment for a\nit is first parameter" , tags : jsdocTestTags } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfos ( {
"40q" : [
"function jsDocParamTest(a: number, b: number, c: number, d: number): number" ,
2018-05-15 21:34:53 +02:00
jsdocTestDocComment
2016-09-09 18:02:55 +02:00
] ,
"40aq" : [
"(parameter) a: number" ,
2018-07-28 01:28:49 +02:00
"this is inline comment for a\nit is first parameter"
2016-09-09 18:02:55 +02:00
]
} ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "41" , docComment : jsdocTestDocComment , parameterDocComment : "this is inline comment for b" , tags : jsdocTestTags } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "41aq" , "(parameter) b: number" , "this is inline comment for b" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "42" , docComment : jsdocTestDocComment , parameterDocComment : "it is third parameter" , tags : jsdocTestTags } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "42aq" , "(parameter) c: number" , "it is third parameter" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "43" , docComment : jsdocTestDocComment , tags : jsdocTestTags } ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "43aq" , "(parameter) d: number" ) ;
2014-07-13 01:04:16 +02:00
2018-10-29 18:03:25 +01:00
verify . completions ( {
marker : "44" ,
includes : [
{
name : "jsDocParamTest" ,
text : "function jsDocParamTest(a: number, b: number, c: number, d: number): number" ,
documentation : jsdocTestDocComment ,
tags : [
{ name : "param" , text : "a it is first parameter" } ,
{ name : "param" , text : "c it is third parameter" } ,
] ,
} ,
{ name : "x" , text : "var x: any" , documentation : "This is a comment" } ,
{ name : "y" , text : "var y: any" , documentation : "This is a comment" } ,
] ,
} ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( { marker : "45" , docComment : "This is function comment\nAnd properly aligned comment" } ) ;
2017-06-07 21:28:52 +02:00
verify . quickInfoAt ( "45q" , "function jsDocCommentAlignmentTest1(): void" , "This is function comment\nAnd properly aligned comment" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
const alignmentDocComment = "This is function comment\n And aligned with 4 space char margin" ;
verify . signatureHelp ( { marker : "46" , docComment : alignmentDocComment } ) ;
verify . quickInfoAt ( "46q" , "function jsDocCommentAlignmentTest2(): void" , alignmentDocComment ) ;
const alignmentTags : ReadonlyArray < FourSlashInterface.JSDocTagInfo > = [
{ name : "param" , text : "a this is info about a\nspanning on two lines and aligned perfectly" } ,
{ name : "param" , text : "b this is info about b\nspanning on two lines and aligned perfectly\nspanning one more line alined perfectly\n spanning another line with more margin" } ,
{ name : "param" , text : "c this is info about b\nnot aligned text about parameter will eat only one space" } ,
] ;
verify . signatureHelp ( {
marker : "47" ,
docComment : alignmentDocComment ,
parameterDocComment : "this is info about a\nspanning on two lines and aligned perfectly" ,
tags : alignmentTags ,
} ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfos ( {
"47q" : [
"function jsDocCommentAlignmentTest3(a: string, b: any, c: any): void" ,
2018-05-15 21:34:53 +02:00
alignmentDocComment
2016-09-09 18:02:55 +02:00
] ,
"47aq" : [
"(parameter) a: string" ,
"this is info about a\nspanning on two lines and aligned perfectly"
]
} ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( {
marker : "48" ,
docComment : alignmentDocComment ,
parameterDocComment : "this is info about b\nspanning on two lines and aligned perfectly\nspanning one more line alined perfectly\n spanning another line with more margin" ,
tags : alignmentTags ,
} ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfoAt ( "48aq" , "(parameter) b: any" , "this is info about b\nspanning on two lines and aligned perfectly\nspanning one more line alined perfectly\n spanning another line with more margin" ) ;
2014-07-13 01:04:16 +02:00
2018-05-15 21:34:53 +02:00
verify . signatureHelp ( {
marker : "49" ,
docComment : alignmentDocComment ,
parameterDocComment : "this is info about b\nnot aligned text about parameter will eat only one space" ,
tags : alignmentTags ,
} ) ;
2016-09-09 18:02:55 +02:00
verify . quickInfos ( {
"49aq" : [
"(parameter) c: any" ,
"this is info about b\nnot aligned text about parameter will eat only one space"
] ,
50 : "class NoQuickInfoClass"
} ) ;