HaxeFoundation / HaxeFoundation/haxe
[ide] object field completion for structure intersections loses the order
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
I'm not sure how this is handled (probably just sort-by-pos.pmin?), and I'm not sure if it's even possible to fix as long as we don't have intersection types in the typed AST (we don't, right?), but it would be great if the order of suggested fields in object declaration completion was dependent on the order of types in the intersection, e.g.:
```haxe
typedef BaseProps = {
var base:Int;
}
typedef ConcreteProps = {
var concrete:Int;
}
function main() {
var props:ConcreteProps & BaseProps = {};
}
```

I'd like "concrete" to show up before "base", because `ConcreteProps` comes before `BaseProps` in the type intersection (or maybe vice-versa, it doesn't matter as long as it's consistent).
Contributor guide
Assessment
This issue has not been assessed yet.