2017-06-22 20:42:12 +02:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
// @allowNonTsExtensions: true
|
|
|
|
// @Filename: test123.js
|
2018-03-02 21:57:29 +01:00
|
|
|
////function fn() {
|
|
|
|
//// /** neat! */
|
|
|
|
//// this.x = 100;
|
|
|
|
////}
|
2017-06-30 00:14:09 +02:00
|
|
|
////
|
2018-03-02 21:57:29 +01:00
|
|
|
/////** awesome
|
|
|
|
//// * stuff
|
|
|
|
//// */
|
|
|
|
////fn.prototype.arr = () => { return ""; }
|
|
|
|
/////** great */
|
|
|
|
////fn.prototype.arr2 = () => [];
|
|
|
|
////
|
|
|
|
/////**
|
|
|
|
//// * This is a cool function!
|
|
|
|
////*/
|
2018-04-05 21:33:00 +02:00
|
|
|
////fn.prototype.bar = function (y) {
|
2018-03-02 21:57:29 +01:00
|
|
|
//// this.x = y;
|
|
|
|
////};
|
2017-06-22 20:42:12 +02:00
|
|
|
|
2018-03-02 21:57:29 +01:00
|
|
|
verify.codeFix({
|
|
|
|
description: "Convert function to an ES2015 class",
|
|
|
|
newFileContent:
|
2017-06-22 20:42:12 +02:00
|
|
|
`class fn {
|
|
|
|
constructor() {
|
2017-06-26 19:54:18 +02:00
|
|
|
/** neat! */
|
2017-06-22 20:42:12 +02:00
|
|
|
this.x = 100;
|
|
|
|
}
|
2017-06-30 00:14:09 +02:00
|
|
|
/** awesome
|
|
|
|
* stuff
|
|
|
|
*/
|
|
|
|
arr() { return ""; }
|
|
|
|
/** great */
|
|
|
|
arr2() { return []; }
|
2017-06-22 20:42:12 +02:00
|
|
|
/**
|
|
|
|
* This is a cool function!
|
|
|
|
*/
|
2018-04-05 21:33:00 +02:00
|
|
|
bar(y) {
|
2017-06-22 20:42:12 +02:00
|
|
|
this.x = y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-30 00:14:09 +02:00
|
|
|
|
2018-03-02 21:57:29 +01:00
|
|
|
`,
|
|
|
|
});
|