Giter Site home page Giter Site logo

bowlerhatllc / vscode-as3mxml Goto Github PK

View Code? Open in Web Editor NEW
250.0 24.0 40.0 6.74 MB

ActionScript & MXML language extension for Visual Studio Code. Develop apps for Adobe AIR, Adobe Flash Player, or Apache Royale.

Home Page: https://as3mxml.com/

License: Apache License 2.0

TypeScript 44.53% ActionScript 0.95% Java 54.04% JavaScript 0.48%
visual-studio-code vscode actionscript mxml language-server swf apache-flexjs adobe-flash-player adobe-air flash

vscode-as3mxml's Introduction

ActionScript & MXML extension for Visual Studio Code

This README file is intended for contributors to the extension. If you simply want to install the latest stable version of the extension, please visit the Visual Studio Marketplace. For help using the extension, visit the vscode-as3mxml wiki for detailed instructions.

Modules

This project is divided into several modules.

  1. language-server provides ActionScript and MXML code intelligence for Visual Studio Code and other editors (like Moonshine IDE) that support the Language Server Protocol. Code intelligence is powered by the ActionScript compiler from Apache Royale, but it supports a variety of ActionScript SDKs. This module is written in Java.

  2. asconfigc creates an executable JAR file that can parse the asconfig.json file format and execute the compiler with the specified options. This module is written in Java.

  3. check-java-version creates an executable JAR file that will verify that the current version of Java meets the minimum requirements for the language server.

  4. check-royale-version creates an executable JAR file that will verify that the current version of the Apache Royale compiler meets the minimum requirements for the language server.

  5. vscode-extension implements various features that are specific to Visual Studio Code, and initializes the language server Java process. This module is written in TypeScript.

  6. distribution packages everything together to create the final extension that is compatible with Visual Studio Code.

Build instructions

Requires JDK 8 (or newer), Apache Maven and Node.js. Run the following command in the root directory to build the extension:

mvn clean package

The extension will be generated in distribution/target/vscode-as3mxml/vscode-as3mxml. This directory may be run inside Visual Studio Code's extension host. Additionally, a .vsix file will be generated that may be manually installed in Visual Studio Code.

Running tests

Tests are run in the Visual Studio Code extension host.

  1. Open the root of this repository in Visual Studio Code.
  2. Goto the View menu, and select Debug.
  3. Choose the Launch Tests configuration.
  4. Goto the Debug menu and select Start Debugging.

Results will appear in the Output view.

Note: If the extension cannot find Apache Royale on your system automatically, you may need to configure the as3mxml.sdk.framework or as3mxml.sdk.editor setting in vscode-extension/src/test/application_workspace/.vscode/settings.json.

Support this project

The ActionScript & MXML extension for Visual Studio Code is developed by Josh Tynjala with the support of community members like you.

Support Josh Tynjala on Patreon

Special thanks to the following sponsors for their generous support:

vscode-as3mxml's People

Contributors

dependabot[bot] avatar joshtynjala avatar neminovno avatar piepie62 avatar varadig 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  avatar  avatar  avatar  avatar

Watchers

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

vscode-as3mxml's Issues

nextgenas.flexjssdk in settings does not point to a valid SDK.

Hi,

I tried to install nextgenass but can't point FlexJS SDK. I downloaded FlexJS from Apache Flex website and modified VSCode User Settings so that "nextgenas.flexjssdk" point to a directory that I store FlexJS but VSCode alway shows error message like,

nextgenas.flexjssdk in settings does not point to a valid SDK. Requires Apache FlexJS 0.7.0 or newer.

System I use

  • macOS 10.12.1
  • VSCode 1.7.2

Check SWCs for design.xml to get suggestions for MXML namespace prefixes

This should happen in MXMLNamespaceUtils.getMXMLNamespaceForTypeDefinition().

Some code to get started:

if (prefix == null)
{
    for (ISWC swc : currentProject.getLibraries())
    {
        if (swc.getSWCFile().getAbsolutePath().equals(definition.getContainingFilePath()))
        {
            //design.xml is an optional file that contains a suggested
            //namespace for the namespaces the SWC contains
            ISWCFileEntry fileInSWC = swc.getFile("design.xml");
            if (fileInSWC != null)
            {
                //TODO: figure out how to parse the file and extract the prefix
            }
        }
    }
}

Example design.xml:

<?xml version="1.0"?>
<design>
	<namespaces>
		<namespace prefix="mike" uri="http://morearty.com/test" />
	</namespaces>

	<categories>
		<category id="mike" label="Mike's stuff" defaultExpand="true" />
	</categories>

	<components>
		<component name="Calculator" namespace="mike" category="mike" insertStyle="control">
			<defaultAttribute name="layout" value="standard" />
			<mxmlProperties>
				<combo id="layout" name="Layout:" />
			</mxmlProperties>
		</component>
	</components>
</design>

Source of sample design.xml: http://www.morearty.com/blog/2008/11/19/extending-flex-builder-sample-code-for-designxml/

Docs for developers

Hey, you said chat so here I am.

Since I have 4 applications built with feathers going to be released soon, my primary focus is AS->Mobile SWF development.

Also as you have noted, MXML is my primary UI so, if I could get a pretty detailed write up or discussion about the moving pieces of this I would love to help.

I am using FB for certain reasons and I have always dreamed about being in control of the IDE I use, reasons the Ranodri compiler (IntelliJ Plugin) and a couple Eclipse extensions were written.

I am all to familiar with Falcon and AST. :) I looked through the code and it's the language serve and your Java that I have no idea how that is plugging in.

Anyway, if you have time, I am a pretty capable programmer with this stuff once I get it but I just don't have the hours to sit and try to get it to build, figure out how things connect and such. (I guess I am speaking about debugging a SWF or calling ADB)

Is there any way to hook up custom HTML Ui in VSCode? Like MXML design view is what I am thinking... way down the road but man, to have it for Feathers and FlexJS might be pretty crazy. I am thinking that you would need a browser, was just curious if there was any API IN VSCode to make custom UI/Panes/Panels whatever they call them.

AS and MXML files not in source-path folders should not be checked for errors

I'm not sure if this a question or a feature request.

Right now, the extension is analyzing all files in any folder of my project with the following extensions: .as, .jsx, .mxml and I'm getting a lot of irrelevant errors and problems.

Ideally the extension could analyze dependencies and only show errors for dependency files. At the very least, it would be very helpful to be able to specify source folder(s) and ignore files in other folders. (i.e. only files inside "src") I'd also like to exclude jsx files because those are Adobe ExtendScript files. I'm guessing it's analyzing those because it thinks they are React files?

asconfig suggestion

Wouldn't it make sense to move the asconfig.json file to the .vscode folder to have all settings in one place? Just looked for this file in a large project and it gets listed at the end while the .vscode folder is on top.

FlexJS Snippets

I've been thinking about the complaints on the FlexJS mailing list about the missing documentation. Now what if somebody familiar with the components in FlexJS writes basically a list of all the components with their respective most used properties and styles and I convert them to user snippets to be used in NextGenAS?
IMO, that would go a long way to make up for the missing docs and allow newbies to get started much faster. I cannot write this list myself since I found myself struggling with FlexJS to just set colors on a label and other basic stuff (and that after years of working with AS3/Flex) :(

What do you think? Might someone be willing to write this list?

Something like (in Flex):

<s:VGroup id="vg" x="10" y="20" gap="10"
paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0"
horizontalAlign="left" verticalAlign="top" ....... />

<s:Label id="lbl" color="0xff0000" textAlign="center" ........ />

Problem with launch.json ?

launch.json: "sourceMaps" labeled as "not allowed here" when using settings for Firefox. Seems to work anyway.

Error when opening second AS3 project

When opening a second AS3 project in a separate window then "NextGen ActionScript extension exited with error code null".
Developer Tools points to:
e.doShow @ messageService.ts:128

Support js-output-optimization and remove-circulars in compilerOptions

Hi Josh,

I'm really liking your extesion.

I'm not sure if I'm doing something wrong, but I tried adding the following items to compilerOptions in the asconfig.json file:
"js-output-optimization": "skipAsCoercions",
"remove-circulars": true,

I get "unknown compiler option" for both of those.

MXML support

  • Syntax coloring
  • Completion
  • Goto Definition
  • Rename
  • Document Symbol
  • Workspace Symbol
  • Hover
  • Find All References
  • ActionScript inside <fx:Script>

config: flex AND node

Is it possible to specify a config for both flexjs and node in the same project? (i.e. "config": "flex,node")

Generate event listener

Completion:

  • In addEventListener() call
  • In MXML event attribute

Code actions:

  • In addEventListener() call
  • In MXML event attribute

Type completion should automatically add imports

Temporary workaround: Click inside the name of the type that is highlighted in red. Press Ctrl + . (Cmd + . on Mac) and a menu will pop up with a command to import the type.


Support for multiple text edits in a completion item was recently added to Visual Studio Code. See the CompletionItem.additionalTextEdits documentation for details. This needs to be exposed by the Language Server Protocol next, and then typefox/ls-api can add it.

See related issues:

COMPILE::JS and COMPILE::SWF

I would like to use the extension for framework development.

Currently, code which contains compiler flags for SWF and JS output, cause an error. How can this be resolved?

Setting lib location breaks SDK references

I have an asconfig file which contains the following:

"compilerOptions": {
    "debug": false,
    "js-output-type": "flexjs",
    "source-map": true,
    "library-path": [
        "lib"
    ],
    "external-library-path": [
    "typedefs"
    ]
},

The lib folder and the typedefs folder is being correctly used, but some Framework files are not being used. I have XML classes and none of the js files related to that are being copied to the js-debug folder.

I'm pretty sure the problem is that it's using "-library-path=lib" instead of "-library-path+=lib".

If I build using ant with the "+=" option, it works.

Can not resolve config constant

Hi Josh,
Nice work on the plugin, this is an exciting project!

Just tried the plugin for the first time with an existing AIR project.
I'm getting a compile error trying to use config constants in my code eg
DEFINE::ANDROID { //android code } DEFINE::IOS { //ios code }

I've tried to define the constants in the asconfig.json as
"additionalOptions": "-define+=DEFINE::IOS,true -define+=DEFINE::ANDROID,false

Empty test.as file in src folder creates problems

First of four errors:

Internal error in syntax tree request subsystem, when generating code for: test.as: java.lang.ArrayIndexOutOfBoundsException: 0
	at org.apache.flex.utils.CheapArray.get(CheapArray.java:133)
	at org.apache.flex.compiler.internal.tree.as.TreeNode.getChild(TreeNode.java:67)
	at org.apache.flex.compiler.internal.units.ASCompilationUnit.handleSyntaxTreeRequest(ASCompilationUnit.java:341)
	at org.apache.flex.compiler.internal.units.CompilationUnitBase.processSyntaxTreeRequest(CompilationUnitBase.java:829)
	at org.apache.flex.compiler.internal.units.CompilationUnitBase.access$100(CompilationUnitBase.java:107)
	at org.apache.flex.compiler.internal.units.CompilationUnitBase$2$1.call(CompilationUnitBase.java:259)
	at org.apache.flex.compiler.internal.units.CompilationUnitBase$2$1.call(CompilationUnitBase.java:255)
	at org.apache.flex.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:228)
	at org.apache.flex.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:222)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
at: 1,1

My config files:
tasks.json:

{
	"version": "0.1.0",
	"command": "asconfigc",
	"isShellCommand": true,
	"args": [
		"--flexHome=F://ApacheFlex_4.15.0_FP19_AIR19"
	],
	"showOutput": "always"
}

asconfig.json:

{
    "config": "air",
    "compilerOptions": {
        "debug": true
    },
    "files":
    [
        "src/Main.mxml"
    ]
}

settings.json:

// Place your settings in this file to overwrite default and user settings.
{
    "editor.fontSize": 11,
    "nextgenas.frameworksdk": "F://ApacheFlex_4.15.0_FP19_AIR19"
}

[0.1.x] MXML errors don't go away after file changes

I have the following code in a component:

<js:TextButton xmlns:js="library://ns.apache.org/flexjs/basic" xmlns:fx="http://ns.adobe.com/mxml/2009"
styleName="baseButton">
fx:Script

</fx:Script>

</js:TextButton>

VS Code is complaining at the first tag:
message: 'This tag could not be resolved to an ActionScript class. It will be ignored.'
at: '2,1'

FB does not report any errors in this file and properly resolves the tag to org.apache.flex.html.TextButton.

MXML should automatically add close tag when open tag is finished and not self-closing

Moved to separate issue: #39

~~~2)  would be nice to have the following: when typing  /  at the end of an MXML tag I'd like to get  />  instead~~~
Moved to separate issue: #40

3)  when typing  >  at the end of an MXML tag I'd like to get the second closing tag inserted automatically. Ideally, the closing tag already 2 lines down and the cursor indented on the line between:
   <s:VGroup id="whatever">
        ......
   </s:VGroup>

Just my 2 cents.

Not stopping at breakpoints in main class constructor

Ok, so I managed to get the compiling working on my mac, it now produces the bin folder and the output js files. The debugger executes the compile task then fires the chrome browser and the script runs but it doesn't stop at the breakpoints. I'm trying to debug using the local file option as per instructions.

asconfig.json example incorrect

the given example for asconfig.json is incorrect:
The last compiler option (in this case "library-path") must not be followed by a comma.

Example given:
`{

"config": "js",

"compilerOptions": {

    "debug": true,

    "library-path": [

        "libs"

    ]**,**    // this comma is not correct

},

"files":

`

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.