We have changed our compile to emit ES6 JavaScript, instead of ES5. That means let or const don't become var etc, it also means that classes are emitted as classes, not as functions.
There are extensions that emit ES5 JavaScript and that extend from our API types. The code usually looks like this:
var PathCompletionItem = (function (_super) {
__extends(PathCompletionItem, _super);
function PathCompletionItem(filename, isfile) {
_super.call(this, filename);
this.foo = 1;
}
PathCompletionItem.prototype.bar = function () {
this.foo += 1;
};
return PathCompletionItem;
}(vscode.CompletionItem));
The challenge is that calling a class-constructor from a function extending it, isn't possible and requires a workaround. We have the es5ClassCompat-util for that. However, there are only eight extensions that use this pattern and this issue track the migration to emitting ES6 code.
Calling static functions using the new keyword (see #69533)
We have changed our compile to emit ES6 JavaScript, instead of ES5. That means
letorconstdon't becomevaretc, it also means that classes are emitted as classes, not as functions.There are extensions that emit ES5 JavaScript and that extend from our API types. The code usually looks like this:
The challenge is that calling a
class-constructor from afunctionextending it, isn't possible and requires a workaround. We have thees5ClassCompat-util for that. However, there are only eight extensions that use this pattern and this issue track the migration to emitting ES6 code.Calling static functions using the
newkeyword (see #69533)new vscode.Uri.fileinu1255/vscode-easy-greenjs#1new vscode.Uri.fileGruntfuggly/todo-tree#133new vscode.TextEdit.replacemikeburgh/vscode-xml-format#5