Editor refactor: extract UI
This commit is contained in:
@@ -53,12 +53,15 @@ export class CommandHook extends EventEmitter<CommandHookEvents>
|
||||
}
|
||||
|
||||
apply(system: System<CommandHookT>): void {
|
||||
this.buildAllCommands(system);
|
||||
system.on({
|
||||
plugLoaded: () => {
|
||||
this.buildAllCommands(system);
|
||||
},
|
||||
});
|
||||
// On next tick
|
||||
setTimeout(() => {
|
||||
this.buildAllCommands(system);
|
||||
});
|
||||
}
|
||||
|
||||
validateManifest(manifest: Manifest<CommandHookT>): string[] {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Hook, Manifest } from "../../plugos/types.ts";
|
||||
import { System } from "../../plugos/system.ts";
|
||||
import { Completion, CompletionContext, CompletionResult } from "../deps.ts";
|
||||
import { safeRun } from "../../common/util.ts";
|
||||
import { Editor } from "../editor.tsx";
|
||||
import { Editor } from "../editor.ts";
|
||||
import { syntaxTree } from "../deps.ts";
|
||||
|
||||
export type SlashCommandDef = {
|
||||
|
||||
Reference in New Issue
Block a user