[PROTOBUS] showTextDocument host bridge (#4586)
* showTextDocument host bridge * format fix * sjf review cleanups * prefer paths over URI based on chats with sjf * also document_uri -> document_path * remove unused metadata import --------- Co-authored-by: Andrei Edell <andrei@nugbase.com>
This commit is contained in:
1 parent
dcf91b081e
commit
c013b4f329
13 files changed
+125
-18
No files matched your search
@@ -1,6 +1,8 @@
|
||||
import * as vscode from "vscode"
|
||||
import { getWorkingState } from "@utils/git"
|
||||
import { writeTextToClipboard } from "@utils/env"
|
||||
import { getHostBridgeProvider } from "@/hosts/host-providers"
|
||||
import { ShowTextDocumentRequest } from "@/shared/proto/host/window"
|
||||
|
||||
/**
|
||||
* Formats the git diff into a prompt for the AI
|
||||
@@ -130,6 +132,10 @@ async function editCommitMessage(message: string): Promise<void> {
|
||||
language: "markdown",
|
||||
})
|
||||
|
||||
await vscode.window.showTextDocument(document)
|
||||
await getHostBridgeProvider().windowClient.showTextDocument(
|
||||
ShowTextDocumentRequest.create({
|
||||
path: document.uri.fsPath,
|
||||
}),
|
||||
)
|
||||
vscode.window.showInformationMessage("Edit the commit message and copy when ready")
|
||||
}
|
||||
Reference in new issue
Block a user