Giter Site home page Giter Site logo

kkevsekk1 / auto.js-vscode-extension Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 710850609/auto.js-vscode-extension

101.0 101.0 71.0 5.84 MB

A simple development plugin for Auto.js.

License: GNU General Public License v2.0

TypeScript 47.03% HTML 1.01% JavaScript 51.96%

auto.js-vscode-extension's People

Contributors

710850609 avatar kkevsekk avatar kkevsekk1 avatar ugynpu2nub8qcfqdrswzgmxmbp43wq avatar voldikss avatar wilinz avatar xiao252 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

auto.js-vscode-extension's Issues

保存项目到设备没反应

单个文件保存到所有设备可以使用,但是保存项目到设备没反应,怎么解决?我有多个js和图片文件要打包在一起。

发现Auto.js-Autox.js-VSCodeExt v1.109.0版本插件一个bug

Auto.js-Autox.js-VSCodeExt v1.109.0
当在vscode工作区加载几个工程时,快捷键触发出命令列表时,选择“Auto.js autoxjs:运行项目(Run Project)”执行,直接报错:
image
截图中的工程我已经关闭掉了,编辑器当前tab页已经打开了切换到其他工程内容了,但是快捷键触发运行项目时,还是已经关闭工程的错误。
烦请看一下是我使用不当,还是插件某些部分没有考虑到

无法执行代码

显示command 'extension.run' not found

版本: 1.76.0 (user setup)
提交: 92da9481c0904c6adfe372c12da3b7748d74bdcb
日期: 2023-03-01T10:22:44.506Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Windows_NT x64 10.0.19045
沙盒化: No

关于Auto.js-Autox.js-VSCodeExt v1.109.0不显示二维码的临时解决办法

需要修改文件 -----.vscode\extensions\aaroncheng.auto-js-vsce-fixed-1.109.0\out\extension.js
类Extension(98行-135行)中的内容

修改前后对比
image_2024-03-16_17-43-33

修改完成之后,需要重启vscode。

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);
    }

保存到所有设备(save)-保存图片

保存图片的话,得到的图片是无效图片,图片打不开。网上搜了一下好像说用fs.readFileSync(filename, 'utf8')这个方式去读图片是会导致数据错误

Bug:无法运行脚本。使用保存项目到设备之后。

Can't resolve relative module ID "./utils/util" when require() is used outside of a module (/android_asset/modules/jvm-npm.js#87)

复现过程

  1. 新建项目,包含一个子目录文件util/util.js,和一个文件main.js保存项目到设备。
  2. 运行main.js。此脚本包含相对路径引用。require('./util/uil.js')
  3. f5调试,出现异常

猜测

  1. vscode插件,发送文件调试。
  2. 位于apk端的服务接受到文件,开始执行。但是此时,执行的根目录,为apk自己默认的 /脚本/ 目录。
    而,因为,之前保存项目到文件,此脚本的其他require文件,已经被包装到了,一个项目目录下,即 /脚本/projectName/。导致此文件的引用找不到。

而在apk断直接运行文件的时候。因为require采用的是相对路径。所以,直接就可以运行。但是vscode远程调试时候,根目录,并没有切换指向。

修改建议

修改范围:

  1. 插件端,发送文件调试的时候,标记,在项目内运行。即,添加,参数,projectPath
  2. apk端,解析这个prejectPath,自动,移动执行path。

备注:如果出现结构层次复杂的场景。建议 projectPath,参数,以手动输入或者文件配置的方式,这样,更加灵活的,使得运行脚本,配置在apk断的依赖目录

实现目标

vscode可以灵活的,在运行脚本的功能中,调整依赖文件路径。并且发送给apk,apk同时能够自动调整path。

注意,建立在猜测基础上的建议,如果存在问题,还请海涵。

9317端口被

2023-10-08 14:02:15.914 [error] [Extension Host] server error: Error: listen EADDRINUSE: address already in use 0.0.0.0:9317
at Server.setupListenHandle [as _listen2] (node:net:1740:16)
at listenInCluster (node:net:1788:12)
at doListen (node:net:1937:7)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

偶发会出现这个端口被占用 因为我这里查看的话又查询不到具体是什么进程使用了该端口, 想问问能否可以 修改端口号

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.