Runs asjsc
from Apache FlexJS™ inside Visual Studio Code. Automatically detects compiler errors, including the line number, and displays them in the editor with your code.
To use, create .vscode/tasks.json
in your project. Use Ctrl+Shift+B to run (or Cmd+Shift+B on Mac).
The command
field assumes that asjsc
is available globally. However, you may use an absolute path instead:
{
"command": "/path/to/asjsc",
}
If you prefer not to show the console output, change the showOutput
field, like this:
{
"showOutput": "never",
}
To see errors when the console is hidden, click the icon in the status bar or press Ctrl+Shift+M (or Cmd+Shift+M on Mac).
Instead of editing the args
field in tasks.json
to add more command line arguments, you can add a configuration file in the same directory as your main class. If your main class is src/HelloWorld.as
, create src/HelloWorld-config.xml
. The compiler will automatically detect this file and use it. For example, if you wanted to add a libs
directory to the library path, you could do it like this:
<?xml version="1.0"?>
<flex-config>
<compiler>
<library-path>
<path-element>../libs</path-element>
</library-path>
</compiler>
</flex-config>
Paths are relative to the configuration file, rather than the root of your project.
Want to see more helpful tips like this? Please become a patron and support the next generation of ActionScript development on the web -- without a plugin!
NextGen ActionScript by Josh Tynjala on Patreon.
Special thanks to the following sponsors for their generous support: