COMMUNITY

Vshaxe 2.22.0 released (implement missing fields quickfix)

To accompany the new Haxe 4.2.0 release, there’s also a new release of vshaxe.

Aside from adding support for the new Haxe features such as abstract classes, we also added support for implementing various kinds of missing fields with a quickfix (requires Haxe 4.2.0+):

Implement Missing Interface / Abstract Class Fields

9JbmKqh2DX

Implement Missing Property Accesors

rUL2ShEZRZ

Create Non-Existent Fields


We also made some other improvements such as updating the bundled haxe-formatter to version 1.11.2. You can find the full changelog here:

22 Likes

thanks ! nice job !

Fantastic! Been waiting for these improvements!
However; i cant really get it to work - not really sure whats wrong?
(Haxe 4.2 + VSHaxe 2.22)

image

@d0oo0p Me neither, can you try with this project? GitHub - Gama11/HaxeRepro

Just run npm install, that installs lix locally, which should rule out any issues with incorrect dependencies.

Ok, tried that - but it makes no difference… :thinking:
Should i get updates to errors live? Because i have to hit build before errors or anything updates… not at all like in the gif’s showing here…

Diagnostics are updated on save (in the gif I have auto-save enabled). Unless you have them turned of globally by chance?

hello,
auto creation of fields can be possible also for static methods?

Not sure if that’s a question or a bug report? :slight_smile: But yes, that should work already:

476wkuTFEZ

Thanks, that was the case with the diagnostics!
So after testing more this is what i found:
-Implement missing function [works]
-Implement missing getter/setters [works]
-Implement abstract fields [works]
-Implement missing interface fields [works on only funcations and not if variables] (no code actions)
-Add non-existent fields [dont work] (no code actions available)

Works fine for me on this code:

abstract class Base {
	abstract function foo():Int;
}

class Main extends Base {
	static function main() {}
}

image

(though it seems to insert an override modifier it shouldn’t, that was required in earlier 4.2 nightlies)


I am able to reproduce one issue with implementing a missing variable though. Not yet sure what’s different compared to the .gif where it worked just yesterday. :slight_smile:

Thank you sooo much for these additions and your work on this extension!

You’re welcome - this time most of the credit goes to @Simn though. :slight_smile:

1 Like

Ok you are right, my mistake - it is “implement missing interface fields” that is not working - updated my post :slight_smile: . But the interesting thing is that if the interface does not have any variables, only methods - it does infact work. So it seems the issue is just related to variables then.

Great update!

For Create Non-Existent Fields is it possible to put the field right under class Main and not in the bottom of the file?

Yep, it would be nice to have the feature. Class fields usually go after static members and before class methods.

don’t work with module-level static declarations?

2.22.1 should fix most issues with missing field generation mentioned here. Better positioning of the inserted field(s) still remains a future todo.

4 Likes