Open
Description
From @Floriferous on August 6, 2018 20:25
When composing a class together through mixins, the intellisense autocompletion does not work properly:
// @flow
/* eslint-env mocha */
import { expect } from 'chai';
import { compose } from 'recompose';
class RootCalculator {
constructor() {
this.initializer = 2;
}
add(a: number, b: number): number {
return a + b;
}
returnVarParent() {
return this.var;
}
return2(): number {
return 2;
}
parentFunc() {
return this.childFunc();
}
}
const withCalc2 = (SuperClass = class {}) =>
class extends SuperClass {
constructor() {
super();
this.initializer = this.initializer * 2;
}
increment(a: number): number {
return a + 1;
}
setVar(value): void {
this.var = value;
}
};
const withCalc3 = SuperClass =>
class extends SuperClass {
constructor() {
super();
this.initializer = this.initializer + 1;
}
multiply(a: number, b: number): number {
return a * b;
}
returnVarChild(): void {
return this.var;
}
return2(): number {
return -2;
}
childFunc() {
return 'it works';
}
};
const UberClass = compose(
withCalc3,
withCalc2,
)(RootCalculator);
const calculator = new UberClass();
calculator. // Wait for autocomplete, it can't find the class methods, or suggests them after plenty of other stuff
Copied from original issue: microsoft/vscode#55910