Status report: April 2019

Hello everybody,

This month brought a couple of changes. Specifically requested by our sponsor, I was able to refactor the “Refactor->Rename…” feature. Now, it no longer renames constructors when class names change. It also works from every caret position within the sources (meaning the class name, or in a “new Class()” expression, or within the type designation of a parameter or method). Trying to rename the “new” constructor itself does nothing. I was unable to disable (grey out) the menu item for the feature when the caret is on the “new” keyword, so the UI clue that the feature is unavailable is missing, but otherwise functions as expected.

The Standard Library location work has morphed into a better detection mechanism for Haxe Toolkits and their component pieces. We should be able to detect all standard configurations, and support non-standard configurations with ease. This work is getting close to finished.

I also worked on getting a version of the plugin that works with IDEA 2019.1. I have brought the build successfully forward to 18.2 and am working on 18.3, both of which have fundamental class signature changes that, unfortunately, require a return to separate sources per version. A plugin built with any 2018.x version will still run in any other 2018.x version of IDEA. (For those who are really interested: Rather than use separate trees, version-specific sources are being placed in the same directory as they were initially, using templates and copied/transformed to the ‘gen’ directory before compiling.)

What I worked on for our sponsors:

1) Refactor->Rename… (Complete)

What I worked on for the Community:

1) More progress on the new UI for standard library locations.

On hold:

1) Tab settings pages and code reformatting engine. This is mostly done, but it needs exhaustive unit tests to be written. The current set is minimal.

Next Month:

1) Build on 2019.1
2) New release
3) Finish tab settings changes.
4) Fix debugging C++ projects with Lime (stretch)
5) Add safeguards so that project rebuilds won’t erase directories outside of the project tree. (stretch)
6) Haxe 4 features? (stretch)

Sponsor priorities:

1) Refactor: New Class/Method/Var from Alt+Enter.
2) Better error detection. (#531) (Next up is dealing with @:allow issues.)
3) Haxe4

Be good, everybody!

-Eric

Status Report: March 2019

Hi folks,

This month, I spent some time fixing Refactor->Rename… issues — specifically when constructors are renamed along with classes. This doesn’t happen all of the time, but when invoked from certain references, rather than the class name itself. Issue 785 documents the issue. There is a secondary issue that the action is disabled (and menu items grayed out) when it should be perfectly valid. I haven’t finished that, but I have made significant progress in terms of understanding why this happens and am now building a Haxe-specific solution, rather than relying on the default Java solution.

I also spent a significant amount of time refactoring the formatting engine because the new changes to the tab settings UI exposed a number of issues and I’ve been testing more scenarios, which also exposed some issues. Things are much better now and I think I’ve finished, except that I haven’t written the unit tests. That always brings some surprises so we will see how that goes. Look for it soon.

Another long-running task that I’ve been working on has been UI changes for STD library settings and toolkit detection. I could just have released the UI change a few months ago. However, I decided to wrap that up with the changes which locate the installed toolkit and detects versions, so that we know what language features are available to the compiler. (To know whether things like arrow functions (lambdas), property settings, new keywords, and the like are available using specific toolkit versions.) Progress this month has been in the realm of locating and running the compiler and tools to get the specific versions.

What I worked on for our sponsors:


1) Type annotation cleanup: All of last months changes are merged.
2) Refactor->Rename…

What I worked on for the Community:

1) Add Haxe-specific tab settings page.
– Rewrote the formatting rule engine.
– Added new rules for a lot of previously ignored situations.
2) Progress on the new UI for standard library locations.

Community Contributions:

None this month

Next month:

1) Finish tab settings pane.
2) Finish Refactor->Rename changes
3) Fix debugging C++ projects when build with Lime. (Currently looks like
an hxcpp issue.)
4) Add safeguards so that project rebuilds won’t erase directories outside
of the project tree.
4) Time for another release!
6) Continue UI for standard library locations.
7) Haxe 4 features?

Be good, everybody!

-Eric

Status report: February 2019

This month I spent a bunch of time working on giving better error highlighting (of actual errors, now that we don’t highlight non-errors so much any more). The basic issue I was tackling was type differences. Things like numeric expressions, which in Haxe are always Floats being assigned to an Integer. This led me down a path of having to do better typing of expressions and some work toward top-down inference and monomorphs. I still have to deal with monomorphing of class fields/properties and structural sub-typing. Both of those are interesting and rather difficult to deal with. (You can look at the Haxe typer if you want a clue as to why.) At any rate, I was able to complete a substantial portion of work and made great headway.

What I worked on for our sponsor:

1) Type annotation cleanup: (ongoing)

  • Detect Float values being assigned to Int variables in variable declarations – including adding selectable quick fixes (such as “Wrap with Std.int()”). (merged – was in-review last month)
  • Detect incompatibility when initializing variables using type-tagged expressions (merged – was waiting for review);
  • Detect incompatibility when initializing variables using parenthesized expressions (merged – was waiting for review);
  • Detect incompatibility during assignment (merged – was in-progress)
  • Limited monomorph detection within a single method (merged – new)
  • Add one-click “quick-fixes” for automatic conversions to standard types, changing declared field type, etc. (merged – new)

What I worked on for the Community:

1) Add Haxe-specific tab settings page.

  • Refactor indent calculations; add “continuation” indenting (for multi-line expressions, parameter lists, etc.).

2) Some progress on the new UI for standard library locations. (It is going slow.)

Community Contributions:

None this month

Next month:

1) Finish tab settings pane.
2) Continue type annotation cleanup. (Sponsor priority)
3) Fix debugging C++ projects when build with Lime. (Currently looks like
an hxcpp issue.)
4) Add safeguards so that project rebuilds won’t erase directories outside
of the project tree.
4) Time for another release!
5) Fix class constructor being inappropriately renamed during class rename
refactoring. (FlowPlay list)
6) Continue UI for standard library locations.
7) Haxe 4 features?

Everybody have a great month.

-Eric

Status report: January 2019

Hi folks,

This month, while I spent a little bit of time understanding and finding how to fix class name refactoring, I realized that it wasn’t as high up my sponsor’s priority list as “Better error detection” was, so I switched gears back to the detection and have spent my time fixing those issues as I find them. The only one that was particularly pointed out in the work description was “var i : int = 10/2;”. I’ve fixed that and a number of other issues and am now working on the highlighted lines here:

Highlighting Type Errors

By the way, the inspections you see here are not limited to Float/Int comparisons; it applies to anything that is assignment [in]compatible. That said, the plugin doesn’t have any real unification support or monomorph type coercion yet.

What I worked on for our sponsors:

1) Type annotation cleanup: (ongoing)

  • Detect Float values being assigned to Int variables in variable declarations – including adding selectable quick fixes (such as “Wrap with Std.int()”). (complete – not reviewed — was in-progress last month)
  • Detect incompatibility when initializing variables using type-tagged expressions (complete – not reviewed);
  • Detect incompatibility when initializing variables using parenthesized expressions (complete – not reviewed);
  • Detect incompatibility during assignment (in-progress)

2) Renaming a class (refactoring) inappropriately renames the constructor. (in-progress)

What I worked on for the Community:

1) Fix review comments and merged “Extract Variable” and “Extract Constant” refactorings. (merged)

  • Added type-tag parsing (in general) and support it during extraction. (completed in January)
  • Detect type and use it to make better name suggestions. (completed in January)
  • Avoid using/allowing keywords as variable names/suggestions. (completed in January)
  • Stop infinite loop when a variable was being extracted to the class level. (completed in December)
  • Avoid Haxe keywords when making variable name suggestions. (complete in December)
  • Fixed multi-select (for renaming all occurrences simultaneously). (completed in December)
  • Fixed semi-colon detection and insertion. (completed in December)

2) Adding tab settings pane (in-progress):

  • Get pane to display. (complete)
  • Save settings and honor them. (complete, except for continuations)
  • Honor continuation settings. (in-progress)

3) Research and preliminary work on Issue #641 – where unexpected directories (e.g. root!) are being deleted.

4) Some progress on the new UI for standard library locations. (It is going slow.)

Community contributions:

1) Updated hxcpp-debugger code with code generated using hxjava 3.2.0 to get rid of warnings and messy class names (m0rkeulv). (merged)

Next month:

1) Finish tab settings pane.
2) Continue type annotation cleanup. (sponsor priority)
3) Fix class constructor being inappropriately renamed during class rename refactoring.
4) Fix debugging C++ projects when build with Lime. (Currently looks like an hxcpp issue.)
5) Time for another release!
6) Continue UI for standard library locations.
7) Haxe 4 features?

Have a great month, everybody!

-Eric

Status Report – December 2018

Happy New Year, everybody!!

This last month was pretty busy for me and I accomplished quite a bit, as you can see below. One of more interesting pieces is doing a better job of pre-compile error detection and removal of incorrect errors being reported. There is a lot more to be done in this arena and I could probably go on forever creating Lint-like behavior, but I will stop when things start getting esoteric. 🙂 For immediate concerns, though I am working on type issues (e.g. passing/assigning an incorrect type) and will next address detecting fields (and their types) in anonymous structures.

The new example project for building Heaps on HashLink was for a response to a discussion on Heaps.io. Folks have been lamenting that it is difficult to get things moving when you are fighting the tooling and environment, and an unfamiliar IDE just makes it harder. So, having workable examples is very useful. Now we have our second one, available on the github repository. More will be coming.

Fixing “Extract Variable,” “Extract Constant,” and AIR debugging was in response to Patreon supporters. (Thank You for you continued support!) If you would like _your_ issues prioritized, that is a good way to get our attention. Of course, if your company becomes a sponsor, you can be guaranteed that your issues will be addressed.

For you folks who like to build the plugin yourselves, we have moved to a Gradle build, rather than the old Ant builds.  It’s a bit easier, particularly because you can now target any version of IDEA while working in your favorite version.  Just open the project normally and everything should just work.  But, if it doesn’t, we’ve also updated the documentation so you can figure it all out.  (Note that we do most of our work on the ‘develop’ branch, so that’s what you need to get the Gradle build — until our next release, anyway.)

What I worked on for our supporters:
1) Type annotation cleanup: (ongoing – not submitted)
– Detect Float values being assigned to Int variables in variable declarations – including adding selectable quick fixes (such as “Wrap with Std.int()”). (in-progress)
– Downgrade visibility (public/private) incompatibility to a warning. (complete – not reviewed)
– Fix “Float = Int” marked as error. (complete – not reviewed)
– Allow Dynamic as an interface type (as the compiler allows). (complete – not reviewed)
2) Auto-close regions: (reviewed and merged)
– Added functionality to auto-close regions when a file is opened.
– Provided check boxes for auto-closing of the various region types (AS3/C#, FlashDevelop, IDEA styles)
– Provided check box for closing unused paths in conditional compilation (#if/#elseif/#else/#end).

What I worked on for the Community:
1) Merge m0rkeulv’s changes to convert from Ant to Gradle builds of the plugin. (Merged)
2) Fix “Extract Variable” and “Extract Constant” refactorings. (Submitted for review)
– Stop infinite loop when a variable was being extracted to the class level.
– Avoid Haxe keywords when making variable name suggestions.
– Fixed multi-select (for renaming all occurrences simultaneously).
– Fixed semi-colon detection and insertion.
3) Allow Adobe AIR targets to be debugged via the flash debugging system. (Merged)
4) Create HeapsOnHLExample, a working sample project including Heaps and Hashlink. (Merged)
5) Finish new UI for standard library locations. (In-progress)

Community Contributions:
1) m0rkeulv’s build changes were actually from June, but we weren’t ready to take them back then.

Next Month’s Goals:
1) More type annotation cleanup.
2) Finish new UI for standard library locations.
3) Bug hunt. Resolve a number of issues which have come up recently:
– Issues debugging C++ projects when built with Lime. (Currently looks like an hxcpp issue.)
4) Support of some new Haxe4 features.

Have a great month.
-Eric

Status Report: November 2018

Hello Everybody,

I hope everyone (at least those in America) had a great Thanksgiving and is looking forward to the Holidays. I wish you all a Merry Christmas and a Happy New Year.

This month I was able to get the 1.1 release of the plugin out the door. For you folks who had been waiting while we ironed out the CPU issues with the last release, I trust you will find this release a lot more to your liking, and hopefully will make use of all of the benefits of the last two releases.

The other thing the I worked on was finalizing the work to infer function return types and propagate [generic] type parameters when resolving method call chains — or in other words: understand objects stored in Maps. That was mostly finished last month. I just had to write some unit tests, which exposed a couple more issues that I also fixed before submitting everything. Now, it’s DONE and released.

So, I have a question for all of you:  Where does Haxe4 support fall into your priorities, and what is your time frame for moving to Haxe4 (if ever)?  Please share your thoughts on the Haxe Community Discourse.

What I worked on for our sponsors:
1) Infer function return types and propagate [generic] type parameters when resolveing method call chains; resolution fixes for generics, typedefs, and array access. (Complete and submitted.)
2) Release 1.1.

What I worked on for the Community:
1) Fixed an ClassCastException in the parameter hints code.
2) Release 1.1!
3) Better handling of comments and DocX comments. (Incomplete.)

No community contributions this month.

Next month’s goals:
1) Finish new UI for standard library locations.
2) Issues debugging C++ projects when built with Lime. (Currently looks like an hxcpp issue.)
3) Bug hunt. Resolve a number of issues which have come up recently:
4) Support for more of the new Haxe4 features.

-Eric

Version 1.1 Released

Hello folks!

We have included a number of new Haxe 4 features as well as increased the responsiveness of IDEA when editing Haxe sources.

You can pick it up at the usual places:

  • Inside of the IntelliJ IDE: Find it in your menus: `File -> Settings… -> Plugins -> Haxe Toolkit`
  • On github. (https://github.com/HaxeFoundation/intellij-haxe/releases/tag/1.1)
  • On JetBrains’ plugin repository.

Enjoy!!

Change notes:

1.1 (HaxeFoundation release)

  • Added support of haxe 4 syntax “enum abstract”.
  • Add support of final syntax introduced in Haxe 4.
  • Add support of new function types syntax introduced in Haxe 4.
  • Increased responsiveness in UI, annotations, and other operations that look up type information by a factor of 10.
  • Now infers generic types from map and array literals. (e.g. [“this” => “yours”] is Map).
  • Now resolves typedefs to underlying types. (e.g. `var v:Null` is resolved as a `String` type.)
  • Now propagates type parameters (generics) properly through typedefs.
  • Now resolves types when used with array access (e.g. `map[0].length` no longer marked as errors).
  • Now infers types of methods without specific typing (e.g. `map.get(0).length` no longer marked as errors).
  • Added support of read/write access separation for “find usages”.
  • Inspections for non-haxe files disabled. (Issue #875)
  • Fixed recognizing type of “this” expression.
  • Fixed bug when physical variables were marked as not real.
  • Fixed searching of interface implementations and inheritance hierarchy.
  • Added find usages support for constructors. (Issue #530)
  • Fixed find usages support for properties.
  • Add completion dropdown when ‘:’ is typed and a type is expected.
  • Fix of support of explicit abstract forwards. Now fields and methods that have not been forwarded will not be resolved as valid.
  • Fixed recognition of standard types.
  • Fixed NPE that occurred if current project sdk was not properly configured.
  • Fix indents for anonymous structures fields and extends list.
  • Fix indents for fat arrow expressions.
  • Fix parsing of anonymous type with empty body.
  • Add anonymous types in anonymous types support.
  • Add anonymous structures names support.
  • Added chained anonymous fields recognition.
  • Add proper generics propagation for anonymous structures, typedefs and classes.
  • Add generic constraint support.
  • Add Null<T> support.
  • Add proper from-to declaration support, types infer and compatibility checks.
  • Fix referenced var-init support check.
  • Automatically change references when moving a class across packages.
  • Add super() call when generating override methods.
  • Generate module and automatically set up SDK, libraries, and run configurations on “Import project from sources.”
  • Create “Hello World” example as initial content for new projects.
  • Auto-open Main.hx when creating a new module.

Status Report: October 2018

Hi folks,

This month, I spent time finishing up the task to infer function return types and propagate [generic] type parameters when resolving method call chains. This took more time than expected. The primary pass was complete last month and had been in code review. It got approved, but needed unit tests. Of course, while writing those, I found another issue that took a bit of effort. So, it’s about ready for real-world testing.

I had expected to get a release out to everybody and I wanted to have this new functionality included. Thus, I waited, and now it’s been another month without a release. That is my top priority now, and I will do so before I work on anything else.

What I worked on for our sponsors:
1) Infer function return types and propagate [generic] type parameters when resolving method call chains. (Complete, except for merging into the code base.) Resolution fixes for generics, typedefs, and array access.

What I worked on for the community:
1) Fixed a few Null Pointer Exceptions for different circumstances.
2) Fixed a stack overflow when locating PSI parent of the same type as the starting element.

Community contributions:
1) Haxe 4 enum abstract support. (Ilya Malanin)
2) Fix NPE occurring while resolving module libraries. (Ilya Malanin)
3) Support of read/write access separation for “Find Usages”.

Next month’s goals:
1) Release 1.1.0
2) (Pushed to next release) Finish new UI for standard library locations.
3) Bug hunt. Resolve a number of small issues that have come up recently.

-Eric

Status Report: September 2018

Hi Folks,

It looks like the CPU over-use bug has been fixed. So, unless I hear different, I’m going to make a release shortly so that everybody can pick it up.

After last month’s status report, one of our sponsor’s employees reported an issue locating types of elements in Maps. We originally thought of it as an extension of resolving generics as we did with Vector. It turns out to be much more complicated than that, requiring fixes to (so far) array access, typedef resolution, and inferring the return types of functions — all of which required enhancement for generics as well. At any rate, that is well on its way to being fixed now.

What I worked on for our sponsors:
1) CPU Over-use bug. Profiling, code path optimization. (Complete.)
2) Infer function return types and propagate [generic] type parameters when resolving method call chains. (In-process.)

What I worked on for the Community:
1) Resolve overlap between my Haxe SDK work and Alexander’s; finish new UI for standard library locations. (In process.)

Community Contributions (Thanks to Alexander Kuzmenko and Ilya Malanin):
1) Add super call to generated override methods. (Alexander)
2) Fixed searching of interface implementations and inheritance hierarchy. (Ilya)
3) Automatically change references to a moved class (refactoring). (Alexander)
4) Fixed bug when physical variables were marked as not real. (Ilya)
5) Fixed recognizing type of “this” expression. (Ilya)
6) Verify a file is a Haxe file before conducting inspections (fixes crash on PyCharm). (Ilya)

Next Month’s goals:
1) Release 1.1 (not 1.3 — we are currently at 1.0.2).
2) (Pushed to next release) Finish new UI for standard library locations.
3) (Stretch) More work toward parsing and syncing project files, leading to the automatic managing for compiler conditional problems.

-Eric

Status Report: August 2018

Hi folks,

A death by a thousand cuts. That’s what the CPU overuse problem really amounted to. By finding a few files that produced the problem, and then spending quite a bit of time in the YourKit profiler, I was able to find a number of places that created small delays, each relatively inconsequential in themselves. As I was attacking each of them, I kept wondering, “Is this the big issue? Is this the smoking gun?” Well, yes and no, as it turns out.

The primary issue was that resolution was slow. It was slow because it was re-doing a lot of work. Adding caching was a help, but no magic bullet. Parsing, itself, was still too slow. In the end, the parsing culprits turned out to be String.split(), the streaming Collections.collect() interface, and parsing float values — all Java intrinsic functions. The answer turned out to be: don’t do those things. Replacing and/or avoiding each of them saved time incrementally.

As it stands, parsing and annotation processing are about ten times as fast as they were. That leaves more time in the UI thread so that colorizing and annotating the sources no longer appear to delay user’s typing response.

What I did for my sponsors:
1) CPU Over-use bug. Profiling, code path optimization. (Complete? In testing.) (Also fixes bug #851)

What I did for the Community:
1) Small number of code reviews.
2) Some work on fixing the debugger launching the wrong configuration when HXML or custom configurations are used.

Community Contributions (Thanks to Alexander Kuzmenko):
1) Auto-setup of the Haxe SDK for new projects.
2) Auto-setup of the Haxe SDK for projects imported from source.
3) Auto-setup of libraries and run configuration when importing from sources.

Next Month:
1) Resolve overlap between my Haxe SDK work and Alexander’s; finish new UI for standard library locations.
2) Release 11.1 (not 11.3 — we are currently at 11.0.2)
3) (Stretch) More work toward parsing and syncing project files, leading to the automatic managing for compiler conditional problems.

-Eric