Skip to content

Track extension es6 output migration #68698

@jrieken

Description

@jrieken

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)

Metadata

Metadata

Assignees

Labels

debtCode quality issuesengineeringVS Code - Build / issue tracking / etc.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions