HaxeFoundation / HaxeFoundation/haxe

[ide] @:structInit vs go to definition on object declaration fields

Open
#9,318 1 comment 0 reactions 1 assignee Claimed by @Simn View on GitHub
feature-ide feature-structInit
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

It sems that `@:structInit` could use some position love, see comments in `Main.main` below:

```haxe
typedef T = {
var field:Int;
}

@:structInit
class C {
public function new(field:Int) {}
}

@:structInit
class D {
var field:Int;
}

class Main {
static function main() {
var t:T = {field: 1}; // clicking on `field` takes to the field position: ideal
var c:C = {field: 1}; // clicking on `field` takes to the contstructor position: not bad, but ideally should take to the argument position (not sure if possible)
var d:D = {field: 1}; // clicking on `field` doesn't work :()
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.