BowlerHatLLC / vscode-as3mxml

ActionScript & MXML language extension for Visual Studio Code. Develop apps for Adobe AIR, Adobe Flash Player, or Apache Royale.
https://as3mxml.com/
Apache License 2.0
256 stars 39 forks source link

AVM2 special operations not detected #727

Closed hydroper closed 1 month ago

hydroper commented 8 months ago

Errors such as:

Definition avm2.intrinsics.memory.li32 could not be found.

occur using the avm2.intrinsics package. But the project compiles fine with asconfigc; any idea?

Here's my asconfigc.json:

{
    "config": "air",
    "type": "app",
    "files": [
        "src/org/agera/crypto/worker/CryptoWorker.as"
    ],
    "application": "app.xml",
    "compilerOptions": {
        "debug": true,
        "omit-trace-statements": false,
        "source-path": ["src"],
        "library-path": ["libs"],
        "output": "build/org.agera.crypto.worker.swf"
    }
}
joshtynjala commented 8 months ago

as3mxml-vscode's cod intelligence doesn't necessarily use the same compiler that gets called by asconfigc, so that's why you see it succeed with asconfigc, but see an error in VSCode. It appears that vscode-as3mxml doesn't know how to find the avm2.intrinsics package. I would have assumed that it's defined in playerglobal.swc (or another .swc) in the SDK, but perhaps not. Maybe Adobe's ASC 2.0 compiler hard-codes these functions. If that's the case, then the Royale compiler used by vscode-as3mxml would need to be modified to support them.

Regardless, it is safe to ignore the error for now, since asconfigc compiles successfully.