SapphireSteel Forum

General => Amethyst => Topic started by: idleBishop on August 20, 2014, 12:06:49 AM

Title: Intellisense / code completion issues
Post by: idleBishop on August 20, 2014, 12:06:49 AM
I'm running into a few issue with code completion, and I can't quite figure out how to fix it. I looked in several other threads, and the issues those threads cover seem to be different than mine. Sorry If I'm repeating anything that's already been covered. Here goes:

1) I noticed that when I try to utilize the code completion feature, code is often completed incorrectly. For example, if I type:


and press ctrl+space to invoke the completion window, I see StageScaleMode.NO_SCALE, which I select, and then I get:

StageScaleMode.NO_NO_SCALE instead of StageScaleMode.NO_SCALE. Is there a more correct way to invoke the code completion option?

2) intellisense doesn't seem to kick in for Vector objects. For example:


private function someTouchHandler(e:TouchEvent):void
    var touchGlobalX:int = e.touches[0].                <-- no intellisense pops up, and nothing happens if I press ctrl+space

Even though e.touches is defined as a Vector of Touch objects, I get nothing.

3) Is there some trick to getting imports to be automatically included? I often type something like

var someObj:CustomCla

Where CustomClass is a class defined in my project in some other package. Sometimes I get the option to choose "CustomClass" and when I do get the option, I choose it and sometimes the import of CustomClass does not appear. Is there a setting that controls this, or is there some bug happening?

4) Is there some sort of delay baked into when ctrl+space invokes the auto-complete options? it seems like it takes well over half a second for the dialog to appear, but I haven't timed it precisely. It would be great to be able to make that faster if possible.

Title: Re: Intellisense / code completion issues
Post by: Dermot on August 21, 2014, 02:49:04 AM
We'll look at these and get back to you with a more detailed response shortly.


Title: Re: Intellisense / code completion issues
Post by: Dermot on August 22, 2014, 08:19:37 AM
We've done some more investigation ...

1) Yes, this is a bug. If you type StageScaleMode. and wait for the dropdown, it will work. If you type StageScaleMode.NO_, it doesn't recognize that the NO_ is already there.

2) The Intellisense should be smarter here. We'll fix that.

3) You should get imports generated automatically if the setting 'Generate import statements' is set to true in Tools | Options | Text Editor | Amethyst | IntelliSense is set.
If I comment out the Events import
and then type (in a function)
var z:Event;
I get an import statement generated. If you are not getting an import statement generated, it means that (I think) IntelliSense doesn't know about your class. Check in the dropdown after the ':'. If your class is there, then you should get an import.

4) This is quite interesting. I hadn't noticed this before, but there is a delay if you look for it. I put some timing code in and measured the delay to be between 400 to 600ms, that is, as you say, about half a second. This is just about on the verge of being noticable, but it is there. I tracked this down to an idle loop parameter which is hardcoded to 1000ms, Setting this to 50ms reduced the delay to less than 100ms - and it is snappier. I don't think that you tell the difference between 100ms and 250ms, but there's definitely a difference between 100ms and 500ms. The loop delay is hardcoded, but we will reduce it to 50ms in the next release.

We're currently working on the next point upgrade (Amethyst 2.2) that supports VS2013 update 3 and various Android/Adobe updates which should be ready in the next couple of weeks and we'll include bugs you've reported.


Title: Re: Intellisense / code completion issues
Post by: idleBishop on August 22, 2014, 11:37:33 AM
Awesome! Thank you so much for looking into all these items and following up with the details. I'll keep working with the tool and let you know if I run into any other questions/comments.

Title: Re: Intellisense / code completion issues
Post by: Dermot on September 02, 2014, 11:24:46 AM
New versions of Amethyst fixing (hopefully) the Vector IntelliSense problem and supporting the latest AIR versions ...

Amethyst is now available for download

The Visual Studio 2010 version is

The Visual Studio 2012 version is

The Visual Studio 2013 version is