(webviewView: vscode.WebviewView | vscode.WebviewPanel)
| 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 |
no test coverage detected