MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / resolveWebviewView

Method resolveWebviewView

src/core/webview/ClineProvider.ts:784–924  ·  view source on GitHub ↗
(webviewView: vscode.WebviewView | vscode.WebviewPanel)

Source from the content-addressed store, hash-verified

782 }
783
784 async resolveWebviewView(webviewView: vscode.WebviewView | vscode.WebviewPanel) {
785 this.view = webviewView
786 const inTabMode = "onDidChangeViewState" in webviewView
787
788 if (inTabMode) {
789 setPanel(webviewView, "tab")
790 } else if ("onDidChangeVisibility" in webviewView) {
791 setPanel(webviewView, "sidebar")
792 }
793
794 // Initialize out-of-scope variables that need to receive persistent
795 // global state values.
796 this.getState().then(
797 ({
798 terminalShellIntegrationTimeout = Terminal.defaultShellIntegrationTimeout,
799 terminalShellIntegrationDisabled = false,
800 terminalCommandDelay = 0,
801 terminalZshClearEolMark = true,
802 terminalZshOhMy = false,
803 terminalZshP10k = false,
804 terminalPowershellCounter = false,
805 terminalZdotdir = false,
806 terminalProfile,
807 ttsEnabled,
808 ttsSpeed,
809 }) => {
810 Terminal.setShellIntegrationTimeout(terminalShellIntegrationTimeout)
811 Terminal.setShellIntegrationDisabled(terminalShellIntegrationDisabled)
812 Terminal.setCommandDelay(terminalCommandDelay)
813 Terminal.setTerminalZshClearEolMark(terminalZshClearEolMark)
814 Terminal.setTerminalZshOhMy(terminalZshOhMy)
815 Terminal.setTerminalZshP10k(terminalZshP10k)
816 Terminal.setPowershellCounter(terminalPowershellCounter)
817 Terminal.setTerminalZdotdir(terminalZdotdir)
818 Terminal.setTerminalProfile(terminalProfile)
819 setTtsEnabled(ttsEnabled ?? false)
820 setTtsSpeed(ttsSpeed ?? 1)
821 },
822 )
823
824 // Set up webview options with proper resource roots
825 const resourceRoots = [this.contextProxy.extensionUri]
826
827 // Add workspace folders to allow access to workspace files
828 if (vscode.workspace.workspaceFolders) {
829 resourceRoots.push(...vscode.workspace.workspaceFolders.map((folder) => folder.uri))
830 }
831
832 webviewView.webview.options = {
833 enableScripts: true,
834 localResourceRoots: resourceRoots,
835 }
836
837 webviewView.webview.html =
838 this.contextProxy.extensionMode === vscode.ExtensionMode.Development
839 ? await this.getHMRHtmlContent(webviewView.webview)
840 : await this.getHtmlContent(webviewView.webview)
841

Callers 1

openClineInNewTabFunction · 0.95

Calls 15

getStateMethod · 0.95
getHMRHtmlContentMethod · 0.95
getHtmlContentMethod · 0.95
postMessageToWebviewMethod · 0.95
logMethod · 0.95
disposeMethod · 0.95
clearWebviewResourcesMethod · 0.95
getCurrentTaskMethod · 0.95
removeClineFromStackMethod · 0.95

Tested by

no test coverage detected