diff --git a/src/editors/ui/ui-editor.ts b/src/editors/ui/ui-editor.ts index f2d7d78..1c343bf 100644 --- a/src/editors/ui/ui-editor.ts +++ b/src/editors/ui/ui-editor.ts @@ -32,23 +32,6 @@ export class UIEditorProvider implements vscode.CustomTextEditorProvider { enableScripts: true }; webviewPanel.webview.html = this.getHtmlForWebview(webviewPanel.webview); - function updateWebview() { - void webviewPanel.webview.postMessage({ - type: 'update', - text: document.getText() - }); - } - const changeDocumentSubscription = vscode.workspace.onDidChangeTextDocument( - (e) => { - if (e.document.uri.toString() === document.uri.toString()) { - updateWebview(); - } - } - ); - - webviewPanel.onDidDispose(() => { - changeDocumentSubscription.dispose(); - }); const delay = async (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); webviewPanel.webview.onDidReceiveMessage(async (e: { type: string }) => { @@ -86,8 +69,6 @@ export class UIEditorProvider implements vscode.CustomTextEditorProvider { throw new Error('Unknown message type'); } }); - - updateWebview(); return Promise.resolve(); } diff --git a/src/editors/ui/webview-ui/main.ts b/src/editors/ui/webview-ui/main.ts index 064803c..9db7dc4 100644 --- a/src/editors/ui/webview-ui/main.ts +++ b/src/editors/ui/webview-ui/main.ts @@ -15,10 +15,6 @@ const vscode = acquireVsCodeApi(); window.addEventListener('load', main); function main() { - const buttons = document.querySelectorAll('vscode-button'); - if (buttons.length === 0) { - throw new Error('No buttons found'); - } const openWithDesignerButton = document.getElementById( 'openWithDesignerButton' );