Skip to content

Commit

Permalink
ui-editor: Delete unused code
Browse files Browse the repository at this point in the history
Change-Id: I312ed7fd0dfff5201dc2f9cc287ed60aab24e3b3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
  • Loading branch information
OrkunTokdemir committed Jun 24, 2024
1 parent 9decf44 commit 5794662
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
19 changes: 0 additions & 19 deletions src/editors/ui/ui-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down Expand Up @@ -86,8 +69,6 @@ export class UIEditorProvider implements vscode.CustomTextEditorProvider {
throw new Error('Unknown message type');
}
});

updateWebview();
return Promise.resolve();
}

Expand Down
4 changes: 0 additions & 4 deletions src/editors/ui/webview-ui/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
Expand Down

0 comments on commit 5794662

Please sign in to comment.