You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Justin M. Hill" <Ju...@Prominic.NET> on 2016/09/07 14:37:53 UTC

Moonshine IDE code completion using Falcon engine

Hi Alex,

You are correct, Moonshine IDE is an AIR application.

If we could make use of the Falcon engine for code completion, that would
be great!   Could you point Santanu in the right direction for at least
where the hooks might be for that so he can investigate further?

I think you should wait to try Moonshine until we release the newest
version in (hopefully) a couple of more days.  We have changed a lot and
integrated the installation process of the ANT, Flex, and FlexJS SDKs so
that new users can get going more quickly.

Thank you,

Justin Hill
My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.





----- Message from Alex Harui <ah...@adobe.com> on Wed, 7 Sep 2016
05:13:39 +0000 -----
                                                                                                                                     
      To: "dev@flex.apache.org" <de...@flex.apache.org>                                                                                
                                                                                                                                     
      cc: Santanu Karar <Sa...@Prominic.NET>, "Dhwani K. Shah" <Dh...@Prominic.NET>, "Kinjal J. Patel" <Ki...@Prominic.NET>,     
          "Atin K. Gupta" <At...@Prominic.NET>, Pan Li <Pa...@Prominic.NET>, Bing Li <Bi...@Prominic.NET>, "Walker L. Dalton"        
          <Wa...@Prominic.NET>, "Efrain Salomon" <Ef...@Prominic.NET>, "Joel C. Anderson" <Jo...@Prominic.NET>                      
                                                                                                                                     
 Subject: Re: FlexJS - roadmap to 1.0 release                                                                                        
                                                                                                                                     

Hi Justin,

Just today I was thinking of finally getting around to trying Moonshine on
my Windows computer.  More below...

On 9/6/16, 9:42 PM, "Justin M. Hill" <Ju...@Prominic.NET> wrote:

>
>Hi Alex and FlexJS community,
>
>Given that 0.70 of FlexJS is nearing release, I would like to revive a
>request I made in April for a roadmap of what is left before we can call
>it
>1.0.

For me, I would like at least one public testimonial that someone was able
to use FlexJS and put an app into production.  We have example apps, but I
want to know if FlexJS can do something a bit more complex.  Other folks
may have different opinions and I could easily change my mind if folks
want to call the release after 0.7.0 our 1.0 release.

>
>It would be really helpful to our cause if we can articulate the major
>bullet points for why someone interested in cross platform development
>should go with FlexJS / AIR vs. Xamarin.  I think it is important for us
>as
>a community to clearly state the benefits beyond just not being a solution
>backed by Microsoft and subject to their whims.

I haven't used Xamarin, plus I think as a member of Apache I'm not
supposed to do opinion-based competitive analysis.  It is fine to state
hard facts though, but in many ways your choice of tools is subjective.
Mostly, I think we need folks who have been successful to articulate the
advantages.

>Finally, we really need help getting code completion put into Moonshine.
>I'd appreciate hearing from anyone who is skilled in building Abstract
>Syntax Trees and parsing them in real time who could contribute this.

Moonshine is an AIR app, correct?  Porting Falcon's AST code to
ActionScript would be a serious project.  I'm wondering if there is some
way to leverage Falcon, possibly as an ANE, or via some other
cross-process communication.  Falcon is already set up to be a
code-completion engine for Flash Builder.

Thoughts?
-Alex

Re: Moonshine IDE code completion using Falcon engine

Posted by Vulcansoft <mi...@vulcansoft.com>.
Hi Santanu4ver,

you may not like this, but have you thought about using MS Visual Studio Code
as the base IDE instead of writing another one yourself? Just stumbled upon
this IDE today and it looks really good, it’s free, it's very fast, but only has basic
ActionScript support (language modules can be written by outsiders).

What this thing could use is a perfect language module for AS3, Flex &
FlexJS !! How about it?

It’s free, available for Mac, Windows, Linux. Check it out here:
https://code.visualstudio.com

-Christian



> On Sep 9, 2016, at 6:56 AM, santanu4ver <sa...@gmail.com> wrote:
> 
> Alex Harui wrote
>> Moonshine is an AIR app, correct?  Porting Falcon's AST code to
>> ActionScript would be a serious project.  I'm wondering if there is some
>> way to leverage Falcon, possibly as an ANE, or via some other
>> cross-process communication.  Falcon is already set up to be a
>> code-completion engine for Flash Builder.
> 
> Hi Alex,
> 
> I was looking into the Falcon description page here:
> https://cwiki.apache.org/confluence/display/FLEX/Falcon+Overview which
> confirms your opinion/suggestion on Falcon's code to use for code-completion
> to an IDE:
> 
> 
> cwiki.apache.org wrote
>> It should be useful as a code-intelligence engine and incremental compiler
>> for an integrated development environment, and not just as a command-line
>> compiler.
> 
> As a complete beginner to understand Falcon, can you give us or point us to
> some more details on this? We would like to know what is Falcon's AST codes,
> where we can found this? If anyway we able to port the codes to an ANE, can
> you give suggestion how it should act to an IDE's code, how an IDE should
> communicate to it to extract necessary code completion hints. 
> 
> Thank you.
> 
> 
> 
> --
> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Moonshine-IDE-code-completion-using-Falcon-engine-tp54918p55002.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: Moonshine IDE code completion using Falcon engine

Posted by Josh Tynjala <jo...@gmail.com>.
I dug in and figured things out by trial and error recently, and I think I
ended up exactly where Alex described in regards to the completion engine.

createInvisibleCompilationUnit() is defined on FlexProject (or maybe a
superclass). This will create a compilation unit for a specific file (and
any files that depend on it). A compilation unit contains definitions for
classes/interfaces/functions/etc. Pass in the main class for an application
project, and that should pull in everything.

getCompilationUnits() is also defined on the project. This returns a
collection of all compilation units used by the project after you call
createInvisibleCompilationUnit() for the main class.

The following call will give you all of the public definitions that are in
a package block in a compilation unit:

Collection<IDefinition> definitions =
compilationUnit.getFileScopeRequest().get().getExternallyVisibleDefinitions()

You could use that to build a list of classes and interfaces. Loop through
all of the compilation units and grab anything that's instanceof
ITypeDefinition.

For member access completion, you need to get the scope from a type
definition:

TypeScope typeScope = (TypeScope) typeDefinition.getContainedScope();

Then call this function:

typeScope.getAllPropertiesForMemberAccess();

I'm about to open source an ActionScript plugin for a text editor. You'll
be able to look at my real code at that point, but hopefully these tips can
give you a headstart.

- Josh


On Thu, Sep 8, 2016 at 10:25 PM, Alex Harui <ah...@adobe.com> wrote:

>
>
> On 9/8/16, 9:56 PM, "santanu4ver" <sa...@gmail.com> wrote:
>
> >Hi Alex,
> >
> >I was looking into the Falcon description page here:
> >https://cwiki.apache.org/confluence/display/FLEX/Falcon+Overview which
> >confirms your opinion/suggestion on Falcon's code to use for
> >code-completion
> >to an IDE:
> >
> >
> >cwiki.apache.org wrote
> >> It should be useful as a code-intelligence engine and incremental
> >>compiler
> >> for an integrated development environment, and not just as a
> >>command-line
> >> compiler.
> >
> >As a complete beginner to understand Falcon, can you give us or point us
> >to
> >some more details on this? We would like to know what is Falcon's AST
> >codes,
> >where we can found this? If anyway we able to port the codes to an ANE,
> >can
> >you give suggestion how it should act to an IDE's code, how an IDE should
> >communicate to it to extract necessary code completion hints.
>
> Read the Architecture section of that wiki page.  It may not make a lot of
> sense right now, but a goal is for you to eventually understand it.
>
> I haven't worked with how Falcon was used for code-completion in Flash
> Builder, but you may not need to understand the AST portion of Falcon at
> all.  I think all you really need to know about is the Workspace,
> FlexProject, CompilerProblems, Definitions, and InvisibleCompilationUnit.
>
> I haven't worked with InvisibleCompilationUnit, but I believe it is how
> you send a file of text to be compiled without actually saving it to a
> file.  The compilation generates not just an AST, but also a set of
> CompilerProblems and Definitions.
>
> HTH,
> -Alex
>
>

Re: Moonshine IDE code completion using Falcon engine

Posted by Alex Harui <ah...@adobe.com>.

On 9/8/16, 9:56 PM, "santanu4ver" <sa...@gmail.com> wrote:

>Hi Alex,
>
>I was looking into the Falcon description page here:
>https://cwiki.apache.org/confluence/display/FLEX/Falcon+Overview which
>confirms your opinion/suggestion on Falcon's code to use for
>code-completion
>to an IDE:
>
>
>cwiki.apache.org wrote
>> It should be useful as a code-intelligence engine and incremental
>>compiler
>> for an integrated development environment, and not just as a
>>command-line
>> compiler.
>
>As a complete beginner to understand Falcon, can you give us or point us
>to
>some more details on this? We would like to know what is Falcon's AST
>codes,
>where we can found this? If anyway we able to port the codes to an ANE,
>can
>you give suggestion how it should act to an IDE's code, how an IDE should
>communicate to it to extract necessary code completion hints.

Read the Architecture section of that wiki page.  It may not make a lot of
sense right now, but a goal is for you to eventually understand it.

I haven't worked with how Falcon was used for code-completion in Flash
Builder, but you may not need to understand the AST portion of Falcon at
all.  I think all you really need to know about is the Workspace,
FlexProject, CompilerProblems, Definitions, and InvisibleCompilationUnit.

I haven't worked with InvisibleCompilationUnit, but I believe it is how
you send a file of text to be compiled without actually saving it to a
file.  The compilation generates not just an AST, but also a set of
CompilerProblems and Definitions.

HTH,
-Alex


Re: Moonshine IDE code completion using Falcon engine

Posted by santanu4ver <sa...@gmail.com>.
Alex Harui wrote
> Moonshine is an AIR app, correct?  Porting Falcon's AST code to
> ActionScript would be a serious project.  I'm wondering if there is some
> way to leverage Falcon, possibly as an ANE, or via some other
> cross-process communication.  Falcon is already set up to be a
> code-completion engine for Flash Builder.

Hi Alex,

I was looking into the Falcon description page here:
https://cwiki.apache.org/confluence/display/FLEX/Falcon+Overview which
confirms your opinion/suggestion on Falcon's code to use for code-completion
to an IDE:


cwiki.apache.org wrote
> It should be useful as a code-intelligence engine and incremental compiler
> for an integrated development environment, and not just as a command-line
> compiler.

As a complete beginner to understand Falcon, can you give us or point us to
some more details on this? We would like to know what is Falcon's AST codes,
where we can found this? If anyway we able to port the codes to an ANE, can
you give suggestion how it should act to an IDE's code, how an IDE should
communicate to it to extract necessary code completion hints. 

Thank you.



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Moonshine-IDE-code-completion-using-Falcon-engine-tp54918p55002.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: Moonshine IDE code completion using Falcon engine

Posted by Alex Harui <ah...@adobe.com>.

On 9/7/16, 7:37 AM, "Justin M. Hill" <Ju...@Prominic.NET> wrote:

>
>Hi Alex,
>
>You are correct, Moonshine IDE is an AIR application.
>
>If we could make use of the Falcon engine for code completion, that would
>be great!   Could you point Santanu in the right direction for at least
>where the hooks might be for that so he can investigate further?

I have personally never tried to build an ANE, much less one that uses
Java, but hopefully there are folks on the mailing list with more
experience.

I did find this article [1] that might be useful.

HTH,
-Alex

[1] 
http://help.adobe.com/en_US/air/extensions/WSff7e9115a8550eef-4b2a619513250
2c4d38-8000.html