HeapsIO / hxbit

Haxe Binary serialization and network synchronization library
155 stars 30 forks source link

ArrayProxys auto-complete as Arrays #54

Closed trethaller closed 3 years ago

trethaller commented 3 years ago

When declaring a serializable Array like so:

@:s var array : Array<Object>;

The auto completion considers array to be an Array, while at compile-time it will become an ArrayProxy. This works fine as long as ArrayProxy implements all the same methods as Array, but starts to break when static extensions are added to Array.

For that reason (misleading auto-completion) our developers started declaring ArrayProxies specifically. This works fine, except for length which for some reason is marked as @:noCompletion. Could this be removed?

ncannasse commented 3 years ago

The Array/ArrayProxy is actually a feature, so completion is speedup because we skip hxbit macros processing and codegen when doing completion.

Since I don't remember about why there's @:noCompletion on ArrayProxy I've removed it ;)