mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Merge pull request #16697 from RyanCavanaugh/preserveMethodComments
Preserve method comments in JS->ES6 conversion.
This commit is contained in:
45
tests/cases/fourslash/convertFunctionToEs6ClassJsDoc.ts
Normal file
45
tests/cases/fourslash/convertFunctionToEs6ClassJsDoc.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @allowNonTsExtensions: true
|
||||
// @Filename: test123.js
|
||||
//// function fn() {
|
||||
//// /** neat! */
|
||||
//// this.x = 100;
|
||||
//// }
|
||||
////
|
||||
//// /** awesome
|
||||
//// * stuff
|
||||
//// */
|
||||
//// fn.prototype.arr = () => { return ""; }
|
||||
//// /** great */
|
||||
//// fn.prototype.arr2 = () => [];
|
||||
////
|
||||
//// /**
|
||||
//// * This is a cool function!
|
||||
//// */
|
||||
//// /*1*/fn.prototype.bar = function (x, y, z) {
|
||||
//// this.x = y;
|
||||
//// };
|
||||
|
||||
verify.fileAfterApplyingRefactorAtMarker('1',
|
||||
`class fn {
|
||||
constructor() {
|
||||
/** neat! */
|
||||
this.x = 100;
|
||||
}
|
||||
/** awesome
|
||||
* stuff
|
||||
*/
|
||||
arr() { return ""; }
|
||||
/** great */
|
||||
arr2() { return []; }
|
||||
/**
|
||||
* This is a cool function!
|
||||
*/
|
||||
bar(x, y, z) {
|
||||
this.x = y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
`, 'Convert to ES2015 class', 'convert');
|
||||
Reference in New Issue
Block a user