rbxts-flamework / vscode

The vscode extension which improves the editing experience for Flamework projects.
2 stars 0 forks source link

Bug when auto importing custom component class #3

Open spectrius opened 1 year ago

spectrius commented 1 year ago

https://github.com/rbxts-flamework/vscode/assets/18365144/619e3f96-b67a-4237-a7ba-182827712c20

This bug occurs when auto-importing my custom component wrapper

Here is the source code of said component wrapper:

import { BaseComponent, Component } from "@flamework/components";
import { Janitor } from "@rbxts/janitor";
import { OnStart } from "@flamework/core";
import { Trove } from "@rbxts/trove";

@Component()
export default class DisposableComponent<
        A extends object = {},
        I extends Instance = Instance,
        U extends object | void = void,
    >
    extends BaseComponent<A, I>
    implements OnStart
{
    /** @deprecated */
    protected readonly janitor = new Janitor<U>();
    protected readonly trove = new Trove();

    constructor() {
        super();
    }

    onStart() {
        this.maid.GiveTask(this.janitor);
        this.maid.GiveTask(() => this.trove.destroy());
    }
}