Status report: May 2019

Hi folks,

This month I pent the majority of my time getting the plug-in to build on versions of IntelliJ IDEA 2018.2, 2018.3, and 2019.1. Each version had its own challenges. In the end, I built a new system to create version-specific sources from templated source files. The templates live in the same tree as the normal sources and are copied as necessary to appropriate places for compilation. I was able to avoid using multiple trees as we have in the past, and we again have a reasonable solution to account for version differences so we can continue to support older versions of the IDE.

The end result of this, of course, was to get a build that works on 2019.x versions of IDEA. The build runs, but it doesn’t pass smoke tests — too many errors were being marked because our abstract support was incomplete. So, I’ve already checked in some fixes and have a few more to complete before I can call this good enough.

What I worked on for our sponsors:

1) Create local var from unresolved references (Alt+Enter). (incomplete — on hold until release)
2) Better detection and handling of abstract classes (falls under “Better error detection” task). (incomplete, partially merged, blocking release)
3) Release an updated version (incomplete).

What I worked on for the Community:

1) Building for all current versions of IntelliJ IDEA.
2) 2019.1 release.
3) Std library UI and properly detecting/updating Haxe Toolkits. (Back-burner)

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.
2) Comment formatting — including DOX.

Next Month:

1) New release
2) Fix debugging C++ projects with Lime
3) Finish tab settings changes. (stretch)
4) Add safeguards so that project rebuilds won’t erase directories outside of the project tree. (stretch)
5) 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?

Have a great month, folks.

-Eric

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: 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: 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

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

Status Report: July 2018

Hi folks,

This month, most of my time went to the CPU over-use issue. Thanks to a bug report from Matan Uberstein, I have finally been able to duplicate it on a Windows PC, too. The base problem is that “resolving” (or figuring out what/where the type that is being referred to is defined) has slowed down and it is most apparent when working with large files — either editing or including them. This was due to a restructuring of that code: refactoring to use our model APIs and making it compliant with the Haxe language (if multiple versions of a name were found, we may have picked the wrong one). What I said last month is still true: the background processing of annotations (“Find Unused Imports” and colorizing) is much slower, and that is in large part due to the resolution issue. I have some more optimizations and I’ll keep working on it.

What I did for our sponsors:
1) CPU Over-use bug. Profiling, code path optimization.

What I did for the Community:
1) Small number of code reviews.
2) Worked on using HAXE_STD_LIB environment variable and associated UI and project changes (ongoing).

Contributions from the community:
1) Initial “Hello World!” content for new projects.  (Thanks to Alexander Kuzmenko!)

Next month [same as last month 🙁 ]:
– CPU Over-use: Finish optimizing and/or refactor “Find Unused Imports” inspection.
– Finish using HAXE_STD_LIB environment variable and be able to set it inside of IDEA.
– Fix bug where Neko (NME) is trying to be launched when custom or HXML configurations are specified.
Stretch goal – Release 11.3
Stretch goal – More work toward parsing and syncing project files, leading to the automatic managing for compiler conditional definitions.

Status Report: June 2018

Hi Folks,

June was kind of a slow month, results-wise, but plenty of stuff got worked on…

For my sponsors, most of my time went to dealing with the CPU Over-use issue, where the CPU is running at roughly 300% forever on a Mac.  I’ve been having trouble duplicating the issue exactly.  However, we were able to create a similar results by opening up a specific file, approximately 1000 lines long, with a few dozen imports (including OpenFL). I say “similar” because it’s not clear that it’s the same issue, in that the CPU runs high for a few minutes and then calms back down if no editing occurs. We agree that it *might* be the issue, so I’m addressing it.

In that vein, we found that the problem is the background annotations; specifically, the “Find Unused Imports” inspection. In profiling that code, I have found several hot-spots and have fixed a few of them, bringing the total run time down about 15%. That’s not enough to deal with the problem, though, and the other hot spots aren’t accessible (they are in IDEA’s code — accessing the file caches). Therefore, I’m looking to change the algorithm so that we don’t have to call into IDEA’s code so much.

As for other things that got done over the month, there have not been many checkins, but things have been happening…

What I did for our sponsors:
1) CPU Over-use bug.
1a) Duplicate the sponsor’s code environment on site.
1b) Also set it up for plugin development, so that I can debug and test changes in situ.
1c) Duplicate and profile the bug.
1d) Optimize critical code path, resulted in 15% run time reduction. (Continuing)

What I did for the Community:
1) Code review of Ilya’s latest semantic annotation rewrite — needs changes.
2) Code review for Mads’ build changes (using gradle) — not yet merged, but approved.
3) Checked in the example project showing hxcpp target debugging with openfl.
4) Worked on using HAXE_STD_LIB environment variable and associated UI and project changes (ongoing).

Contributions from the community:
1) Mads’ changes to use gradle instead of ant to build the plugin are complete, but not yet merged. (Waiting for the CPU Over-use bug to be finished; it has higher priority and changing to gradle may be disrupting to work flows.)

Next month:
– CPU Over-use: Finish optimizing and/or refactor “Find Unused Imports” inspection.
– Finish using HAXE_STD_LIB environment variable and be able to set it inside of IDEA.
– Fix bug where Neko (NME) is trying to be launched when custom or HXML configurations are specified.
– Release 11.3 (Stretch goal)
– More work toward parsing and syncing project files, leading to the automatic managing for compiler conditional definitions. (Stretch goal)