[Solved]Haxe VSCode completion for static methods

Hi,

working with vscode noticed that static methods are not appearing in suggestion for imports.
Then digging around found this old issue Completion for unimported static extension functions? · Issue #33 · vshaxe/vshaxe · GitHub :slight_smile:
Its still not possible to add auto import / completion suggestion for public static methods ?

Thank you

No, that feature is not supported yet, but I’m not sure it’s what you’re after anyway - it’s just about static extensions / using, not regular import.

However, the module-level fields that were just merged into Haxe dev recently do appear in “toplevel completion”, which is only consistent, since they’re at the same level as types:

@Gama11
sorry will clarify,

File A.hx
class A {
public static function createA(){...}
}

File B.hx
class B {
public function new() {
final a = createA() // should auto suggest show createA(), but it don't
}
}

Is it possible to have auto suggestion for createA (code hinting) and import or it will work only with module level statics ? :slight_smile:

It will only work with module-level fields for the time being. I’m not sure if auto-imports for class-level statics is something we want, I feel like most of the time, you don’t want to statically import static fields on classes, so it could get in the way.

1 Like

Thank you will wait then for module level fields to be released :slight_smile:

You can download the Haxe 4,2 nightly, it’s referenced on Simn’s recent blog post from the main haxe site if you want to try them out early, trilateral3 experiments with using them.