Переглянути джерело

Add an activation command for other extensions (#2073)

Since VS Code provides no actionEvents that trigger when a specific
extension activates, extensions can't activate only once Roo is
activated and ready.

This commit introduces a new roo-cline.activationCompleted command
and fires it at the very end of extension activation. Other
extensions that use Roo's exported APIs can now activate when they
see this event.

Co-authored-by: Greg Taylor <[email protected]>
Greg Taylor 9 місяців тому
батько
коміт
5fbf563216
2 змінених файлів з 4 додано та 0 видалено
  1. 1 0
      src/activate/registerCommands.ts
  2. 3 0
      src/extension.ts

+ 1 - 0
src/activate/registerCommands.ts

@@ -50,6 +50,7 @@ export const registerCommands = (options: RegisterCommandOptions) => {
 
 const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOptions) => {
 	return {
+		"roo-cline.activationCompleted": () => {},
 		"roo-cline.plusButtonClicked": async () => {
 			await provider.removeClineFromStack()
 			await provider.postStateToWebview()

+ 3 - 0
src/extension.ts

@@ -115,6 +115,9 @@ export async function activate(context: vscode.ExtensionContext) {
 	registerCodeActions(context)
 	registerTerminalActions(context)
 
+	// Allows other extensions to activate once Roo is ready.
+	vscode.commands.executeCommand('roo-cline.activationCompleted');
+
 	// Implements the `RooCodeAPI` interface.
 	return new API(outputChannel, provider)
 }