MCPcopy Create free account
hub / github.com/Marus/cortex-debug / resolveWebviewView

Method resolveWebviewView

src/frontend/rtos/rtos.ts:378–413  ·  view source on GitHub ↗
(
        webviewView: vscode.WebviewView,
        context: vscode.WebviewViewResolveContext,
        token: vscode.CancellationToken
    )

Source from the content-addressed store, hash-verified

376 constructor(private readonly extensionUri: vscode.Uri, private parent: RTOSTracker) { }
377
378 public resolveWebviewView(
379 webviewView: vscode.WebviewView,
380 context: vscode.WebviewViewResolveContext,
381 token: vscode.CancellationToken
382 ) {
383 this.webviewView = webviewView;
384 this.parent.visible = this.webviewView.visible;
385 this.parent.enabled = true;
386
387 webviewView.webview.options = {
388 // Allow scripts in the webview
389 enableScripts: true,
390 localResourceRoots: [this.extensionUri]
391 };
392 this.webviewView.description = 'View RTOS internals';
393
394 this.webviewView.onDidDispose((e) => {
395 this.webviewView = undefined;
396 this.parent.notifyPanelDisposed();
397 });
398
399 this.webviewView.onDidChangeVisibility((e) => {
400 this.parent.visibilityChanged(this.webviewView.visible);
401 });
402
403 this.updateHtml();
404
405 webviewView.webview.onDidReceiveMessage((msg) => {
406 switch (msg?.type) {
407 case 'refresh': {
408 this.parent.update();
409 break;
410 }
411 }
412 });
413 }
414
415 public showAndFocus() {
416 if (this.webviewView) {

Callers

nothing calls this directly

Calls 4

updateHtmlMethod · 0.95
notifyPanelDisposedMethod · 0.80
visibilityChangedMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected