(
webviewView: vscode.WebviewView,
context: vscode.WebviewViewResolveContext,
token: vscode.CancellationToken
)
| 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) { |
nothing calls this directly
no test coverage detected