9 Replies Latest reply on Jun 5, 2009 12:59 PM by onedayitwillmake

    Syntax coloring / Keyword adding

    onedayitwillmake

      In Flash Builder 4, (sorry I'm still downloading, seems a bit slow today, surprise)

       


      Will it be a big pain in the neck to change the syntax coloring?

      Could I add my own keywords to some kind of list.

       


      This release seems to be playing catch up to FlashDevelop (I view this as a good thing):


      Automatic generation of Getter/Setters...

      Automatic generation of Event handlers...

      Conditional breakpoints for debuging (Yes it has that)...

      View ASDoc style documentation during code hinting...

       


      --

       


      So could you guys please also add two things?

       


      1:

       

      One huge gripe I have is the fact that I can't change the colors in FlexBuilder to match my liking, and SO many terms are colored using the default

      that it almost makes syntax coloring a bit worthless.

       


      2:

       

      I'd like to be able to change the list of keywords / reserved words / class names / instristic class to add whichever I feel like.

       

      I like having addEventListener/removeEventListener/addChild/removeChild/getChildAt/getChildByName different color than everything else because I use them so much. I enjoy being able to tell what's what at a glance. Once they're colored I know there's no typographical errors.

       

       

       

      Ok three things...

       


      3:

       

      Code hinting in FlexBuilder leaves a lot to be desired. In FlashDevelop if I have a property named _viewPortTop, i could hit enter for the new line, then start typing 'top', and the available options will come up pruning the possible choices as they are filtered out.

       


      In flex builder, I HAVE to put 'this'., to even GET the list or press ctrl+space which is cumbersome to do each and every time. If i even make a typo, BAM, whole list is gone.

       

      I don't like seeing 'this' all over the place, since 'this' is assumed in scope.

      If there's an error, then it's a scope issue, go fix it.

      I don't want to clutter my code just cus the hinting is lackluster.

       

      ---

       

       

       

       

       

      ---

       

      Mario Gonzalez

      http://onedayitwillmake.com

      Senior Developer | WDDG.com

        • 1. Re: Syntax coloring / Keyword adding
          Jason San Jose Adobe Employee

          Hi Mario,

           

          1. Content-specific syntax highlighting

          Please file a feature request to http://bugs.adobe.com. It's an interesting concept.

           

          2. Substring matching code hints http://bugs.adobe.com/jira/browse/FB-18507

          FB-18507 has been deferred for this release. Please vote. As a side note, FB4 supports camel case code hints now. For example, "ADG" will give you AdvancedDataGrid or "gDBN" will give you "getDefinitionByName".

           

          3. Code hints scoping

          "this." qualifier is not required. In an unqualified expression (e.g. not member access...without "myvar." or "myReturnCall().") you should always get all definitions in scope. If you observe missing definitions, that is a bug. This "this." issue has not come up from our prerelease customers. If you have a reproducible case, please file a bug.

           

          Thanks for your feedback and participation in the beta.

           

          Jason San Jose

          Quality Engineer, Flash Builder

          1 person found this helpful
          • 2. Re: Syntax coloring / Keyword adding
            onedayitwillmake Level 1

            Hi jasonsj thanks for your reply.

             

             

             

            1 - Ok I'll do that

             

            2 - That seems like it might be useful, however will it work on closest match? If you make a typo, for example I type "addevntli", will the entire list disappear as it currently does?

             

            3 - I just tried and the behavior is same as before:
            If I type for example:

             

            "addEve..." - Code hinting does NOT come up
            "this.addEve..." - Code hinting DOES come up.

             

             

             

            Mario Gonzalez

            http://onedayitwillmake.com

            Senior Developer | WDDG.com

            • 3. Re: Syntax coloring / Keyword adding
              Jason San Jose Adobe Employee

              2. If you make a typo, in general, we don't try to guess code hint proposals. Even if substring matching were supported someday, I'm not sure typo assist is the right answer.

               

              3. Please file a bug with an example file (for full context) and steps to reproduce ASAP. File it against "Code Hints: AS"

               

              Jason San Jose

              Quality Engineer, Flash Builder

              • 4. Re: Syntax coloring / Keyword adding
                onedayitwillmake Level 1

                Alright I will file those two bugs / feature request asap.

                 

                For #2, what I mean is. If i make a typo, i would like the list to stay as is from the last match."addEventLis" - will bring up the possible matches, but if I accidently hit "addEventListN" - keep the list at the last match. If you make a typo, the whole list is gone forever, after you backspace and fix the typo the list doesn't come back.

                 

                 

                 

                Mario Gonzalez

                http://onedayitwillmake.com/

                Senior Developer | WDDG.com

                • 5. Re: Syntax coloring / Keyword adding
                  Scott Evans (Adobe) Adobe Employee

                  Yah, there's a bug open for that "typo" issue already -- http://bugs.adobe.com/jira/browse/FB-18505

                   

                  It's related to an Eclipse issue, so you might want to vote up t he Eclipse bug too if you have a minute.

                   

                  In the meantime, you can hit ctrl-space to bring the hints back up.

                   

                   

                  gse

                  • 6. Re: Syntax coloring / Keyword adding
                    Jason San Jose Adobe Employee

                    Hi Mario,

                     

                    I just read your bug http://bugs.adobe.com/jira/browse/FB-20285 and your workaround: "Press ctrl+space, EVERYTIME you want code hinting without having to tyoe 'this'"

                     

                    This is by design, not a bug. I believe what you maybe misinterpreted as a feature is that code hints show up by simply typing. This is not true. We follow the JDT convention for explicit code hinting and implicit code hinting for AS in most cases. See auto activation in the JDT preferences for more information.

                     

                    We also have implict code hinting for MXML cases. Here are some examples of both AS and MXML:

                     

                    Implicit code hints:

                    Start of MXML tag "<"

                    Start of attribute inside an MXML tag "<s:Button " the space character triggers code hints

                    Member access "myButton." the period character triggers code hints

                    Extends keyword "extends " the space character triggers code hints

                    Vector type declaration "Vector.<" the < character triggers code hints

                    new expression "var foo:Button = new " the space character triggers hints

                     

                    Explicit code hints can be triggered with CTRL+Space at the user's discretion.

                     

                    For the case your are referring to, there is no implicit trigger character. You do have to hit CTRL+space in this case, that's the expected workflow in Eclipse.  I think you are suggesting that any AS identifier character always trigger code hints. Are there other IDE's that you've used that do this? I'm curious to see an example.

                     

                    Jason San Jose

                    Quality Engineer, Flash Builder

                    • 7. Re: Syntax coloring / Keyword adding
                      onedayitwillmake Level 1

                      Yes FlashDevelop has this feature, it's quite useful for users who do not like to add the qualifier 'this' infront of everything within a class since it is already assumed in scope.

                       


                      Here's an example of it in practice.

                      • 8. Re: Syntax coloring / Keyword adding
                        Jason San Jose Adobe Employee

                        Thanks Mario. Just to be clear though, there are two existing options here for showing code hints when starting with an empty statement...

                         

                        1) Type "this." and show code hints implicitly (5 keystrokes)

                        2) Explictly show code hints CTRL+Space (2 keystrokes)

                         

                        It's still quite usable, and follows precedent in Eclipse. I know I've gone into depth about this, but I want to make sure that it's not mischaracterized that code hints are broken (again, "this." is not a requirement).

                         

                        Jason San Jose

                        Quality Engineer, Flash Builder

                        • 9. Re: Syntax coloring / Keyword adding
                          onedayitwillmake Level 1

                          Right I understand, I suppose it isn't a bug then. You've made your case pretty clear on that one

                           

                          Maybe more of a feature enhancement, for the code hinting to auto trigger at differently. I know it's trying to mirror eclipse but if that's its only goal why bother making the product, eclipse already exist.