需要修改文件 -----.vscode\extensions\aaroncheng.auto-js-vsce-fixed-1.109.0\out\extension.js
类Extension(98行-135行)中的内容
class Extension {
constructor() {
this.documentViewPanel = undefined;
this.qrCodeViewPanel = undefined;
this.documentCache = new Map();
}
showServerAddress() {
let servers = server.getIPs().join(":" + server.getPort() + " or ") + ":" + server.getPort();
vscode.window.showInformationMessage(`Auto.js Autox.js \r\n server running on ${servers}`);
}
showQrCode() {
let ips = server.getIPs();
if (ips.length == 1) {
this.showQrcodeWebview(ips[0]);
} else {
vscode.window.showQuickPick(ips).then(ip => {
this.showQrcodeWebview(ip);
});
}
}
showQrcodeWebview(ip) {
let url = `ws://${ip}:${server.getPort()}`;
if (!this.qrCodeViewPanel) {
this.qrCodeViewPanel = vscode.window.createWebviewPanel('Qr code', "Qr code", vscode.ViewColumn.Beside, {
enableScripts: true,
});
this.qrCodeViewPanel.onDidDispose(() => {
this.qrCodeViewPanel = undefined;
}, undefined, exports._context.subscriptions);
}
this.qrCodeViewPanel.webview.html = this.getQrCodeHtml(this.qrCodeViewPanel.webview, url);
}
getQrCodeHtml(webview, text) {
const icon = this.getVscodeResourceUrl(webview, "logo.png");
const qrcodejs = this.getVscodeResourceUrl(webview, "assets/qrcode.js");
return `<!DOCTYPE html>
getVscodeResourceUrl(webview, relativePath) {
const onDiskPath = vscode.Uri.file(path.join(exports._context.extensionPath, relativePath));
return webview.asWebviewUri(onDiskPath);
}