diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-06-15 08:57:55 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-06-15 08:57:55 -0700 |
commit | 0c33de59e472b53ea2a4d9aadde391b5b10343d4 (patch) | |
tree | e60c10cf0d92cef4230809d9b5ff6c92aa6fd037 /extension/src/debugPanel.ts | |
parent | 0eb6d13e2c9632f842910b0d885deb97d875eac8 (diff) | |
download | sncontinue-0c33de59e472b53ea2a4d9aadde391b5b10343d4.tar.gz sncontinue-0c33de59e472b53ea2a4d9aadde391b5b10343d4.tar.bz2 sncontinue-0c33de59e472b53ea2a4d9aadde391b5b10343d4.zip |
left panel
Diffstat (limited to 'extension/src/debugPanel.ts')
-rw-r--r-- | extension/src/debugPanel.ts | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/extension/src/debugPanel.ts b/extension/src/debugPanel.ts index 7407faf4..bb98eb46 100644 --- a/extension/src/debugPanel.ts +++ b/extension/src/debugPanel.ts @@ -136,7 +136,6 @@ let streamManager = new StreamManager(); export let debugPanelWebview: vscode.Webview | undefined; export function setupDebugPanel( panel: vscode.WebviewPanel | vscode.WebviewView, - context: vscode.ExtensionContext | undefined, sessionId: string ): string { debugPanelWebview = panel.webview; @@ -165,6 +164,11 @@ export function setupDebugPanel( .toString(); } + panel.webview.options = { + enableScripts: true, + localResourceRoots: [vscode.Uri.joinPath(extensionUri, "react-app/dist")], + }; + const nonce = getNonce(); vscode.window.onDidChangeTextEditorSelection((e) => { @@ -488,13 +492,21 @@ export function setupDebugPanel( </html>`; } -// class ContinueGUIWebviewViewProvider implements vscode.WebviewViewProvider { -// public static readonly viewType = "continue.continueGUIView"; -// resolveWebviewView( -// webviewView: vscode.WebviewView, -// context: vscode.WebviewViewResolveContext<unknown>, -// token: vscode.CancellationToken -// ): void | Thenable<void> { -// setupDebugPanel(webviewView, context, sessionId); -// } -// } +export class ContinueGUIWebviewViewProvider + implements vscode.WebviewViewProvider +{ + public static readonly viewType = "continue.continueGUIView"; + private readonly sessionId: string; + + constructor(sessionId: string) { + this.sessionId = sessionId; + } + + resolveWebviewView( + webviewView: vscode.WebviewView, + _context: vscode.WebviewViewResolveContext, + _token: vscode.CancellationToken + ): void | Thenable<void> { + webviewView.webview.html = setupDebugPanel(webviewView, this.sessionId); + } +} |