-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: ygqygq2 <ygqygq2@qq.com>
- Loading branch information
Showing
25 changed files
with
214 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
sampleWorkspace/function-comment-for-ts/class-get-optional-params-with-type.result.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class ClassA { | ||
/** | ||
* @description | ||
* @return default {auto} | ||
* @param a {string} | ||
* @param [b='b'] {string} | ||
* @param [c] {string} | ||
*/ | ||
get func(a: string, b:string = 'b', c?: string) { | ||
return a + b + c; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
sampleWorkspace/function-comment-for-ts/class-get-optional-params-with-type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class ClassA { | ||
get func(a: string, b:string = 'b', c?: string) { | ||
return a + b + c; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
sampleWorkspace/function-comment-for-ts/class-get-without-params-type.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class ClassA { | ||
get a() { | ||
return 'test'; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
sampleWorkspace/function-comment-for-ts/class-get-without-params-type.result.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class ClassA { | ||
/** | ||
* @description | ||
* @return default {auto} | ||
*/ | ||
get a() { | ||
return 'test'; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
sampleWorkspace/function-comment-for-ts/class-get-without-params-type.result.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class ClassA { | ||
/** | ||
* @description | ||
* @return default {auto} | ||
*/ | ||
get a() { | ||
return 'test'; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
sampleWorkspace/function-comment-for-ts/class-get-without-params-type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class ClassA { | ||
get a() { | ||
return 'test'; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
sampleWorkspace/function-comment-for-ts/class-public-optional-params-with-type.result.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class classA { | ||
/** | ||
* @description | ||
* @return default {string} | ||
* @param a {string} | ||
* @param [b='b'] {any} | ||
* @param [c] {string} | ||
*/ | ||
public func(a: string, b = 'b', c?: string): string { | ||
return a + b + c; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
sampleWorkspace/function-comment-for-ts/class-public-optional-params-with-type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class classA { | ||
public func(a: string, b = 'b', c?: string): string { | ||
return a + b + c; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
sampleWorkspace/function-comment-for-ts/class-public-optional-params-without-type.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class classA { | ||
public func(a, b = 'b') { | ||
return a + b; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
sampleWorkspace/function-comment-for-ts/class-public-optional-params-without-type.result.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class classA { | ||
/** | ||
* @description | ||
* @return default {auto} | ||
* @param a {any} | ||
* @param [b='b'] {any} | ||
*/ | ||
public func(a, b = 'b') { | ||
return a + b; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
sampleWorkspace/function-comment-for-ts/class-public-optional-params-without-type.result.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class classA { | ||
/** | ||
* @description | ||
* @return default {string} | ||
* @param a {any} | ||
* @param [b='b'] {any} | ||
*/ | ||
public func(a, b = 'b'): string { | ||
return a + b; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
sampleWorkspace/function-comment-for-ts/class-public-optional-params-without-type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class classA { | ||
public func(a, b = 'b'): string { | ||
return a + b; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
sampleWorkspace/function-comment-for-ts/generator-function-optional-params-type.result.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* @description | ||
* @return default {Generator<string>} | ||
* @param a {string} | ||
* @param [b='b'] {any} | ||
* @param [c] {string} | ||
*/ | ||
export function* func(a: string, b = 'b', c?: string): Generator<string> { | ||
console.log(a + b); | ||
yield a + b; | ||
} |
4 changes: 4 additions & 0 deletions
4
sampleWorkspace/function-comment-for-ts/generator-function-optional-params-type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export function* func(a: string, b = 'b', c?: string): Generator<string> { | ||
console.log(a + b); | ||
yield a + b; | ||
} |
10 changes: 10 additions & 0 deletions
10
sampleWorkspace/function-comment-for-ts/generator-function-with-params-type.result.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* @description | ||
* @return default {Generator<string>} | ||
* @param a {string} | ||
* @param b {string} | ||
*/ | ||
export function* func(a: string, b: string): Generator<string> { | ||
console.log(a + b); | ||
yield a + b; | ||
} |
4 changes: 4 additions & 0 deletions
4
sampleWorkspace/function-comment-for-ts/generator-function-with-params-type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export function* func(a: string, b: string): Generator<string> { | ||
console.log(a + b); | ||
yield a + b; | ||
} |
4 changes: 4 additions & 0 deletions
4
sampleWorkspace/function-comment-for-ts/generator-function-without-params-type.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export function* func(a, b) { | ||
console.log(a + b); | ||
yield a + b; | ||
} |
10 changes: 10 additions & 0 deletions
10
sampleWorkspace/function-comment-for-ts/generator-function-without-params-type.result.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* @description | ||
* @return default {auto} | ||
* @param a {any} | ||
* @param b {any} | ||
*/ | ||
export function* func(a, b) { | ||
console.log(a + b); | ||
yield a + b; | ||
} |
10 changes: 10 additions & 0 deletions
10
sampleWorkspace/function-comment-for-ts/generator-function-without-params-type.result.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* @description | ||
* @return default {auto} | ||
* @param a {any} | ||
* @param b {any} | ||
*/ | ||
export function* func(a, b) { | ||
console.log(a + b); | ||
yield a + b; | ||
} |
4 changes: 4 additions & 0 deletions
4
sampleWorkspace/function-comment-for-ts/generator-function-without-params-type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export function* func(a, b) { | ||
console.log(a + b); | ||
yield a + b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { functionCommentTester } from './common/functionCommentTester'; | ||
import { TestInfo } from './types'; | ||
|
||
const testInfo: TestInfo = [ | ||
{ | ||
testName: 'ts-generatorFunction', | ||
workspaceName: 'function-comment-for-ts', | ||
files: [ | ||
{ fileName: 'generator-function-optional-params-type.ts', cursorLine: 0 }, | ||
{ fileName: 'generator-function-with-params-type.ts', cursorLine: 0 }, | ||
{ fileName: 'generator-function-without-params-type.ts', cursorLine: 0 }, | ||
{ fileName: 'generator-function-without-params-type.js', cursorLine: 0 }, | ||
], | ||
}, | ||
]; | ||
|
||
functionCommentTester(testInfo); |