Add basic file references provider for markdown

Fixes #146267
This commit is contained in:
Matt Bierner
2022-04-05 11:53:56 -07:00
parent 111b58221c
commit 0496c2b3a7
8 changed files with 245 additions and 37 deletions

View File

@@ -21,9 +21,11 @@ export class CommandManager {
this.commands.clear();
}
public register<T extends Command>(command: T): T {
public register<T extends Command>(command: T): vscode.Disposable {
this.registerCommand(command.id, command.execute, command);
return command;
return new vscode.Disposable(() => {
this.commands.delete(command.id);
});
}
private registerCommand(id: string, impl: (...args: any[]) => void, thisArg?: any) {
@@ -33,4 +35,4 @@ export class CommandManager {
this.commands.set(id, vscode.commands.registerCommand(id, impl, thisArg));
}
}
}