HaxeFoundation / HaxeFoundation/haxe

Broken completion in display test cases

Open
#11,225 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

Happens because of `@:pos`.
And second bug, if you uncomment `// return fields;`, try completion in `Main.main`, it will work, but will stop after checking `Macro.hx` tab and moving back to `Main.hx`.
```haxe
@:build(Macro.buildTestCase())
class Main {
static function main() {
var foo = "foo";
}
}

Macro.hx:

import haxe.macro.Context;
import haxe.macro.Expr;

class Macro {
static function buildTestCase():Array {
var fields = Context.getBuildFields();
// return fields;
var c = Context.getLocalClass().get();
for (field in fields) {
switch (field.kind) {
case FFun(f) if (f.expr != null):
f.expr = macro @:pos(f.expr.pos) {
var abc = 0;
${f.expr}
};
case _:
}
}
return fields;
}
}
```

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.