Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocompletion doesn't work when adding noCompletion in a build class #269

Open
ciscoheat opened this issue Feb 10, 2017 · 2 comments
Open

Comments

@ciscoheat
Copy link

With Haxe 3.4, adding @:noCompletion to a class created with a build macro prevents autocompletion.

Main.hx

@:build(Builder.build())
class Main 
{	
	static function main() {
		new Main();
	}

	public function new() {
		this.| // "No autocompletion available"
	}
	
	public function start() {
		trace("start");
	}
	
	@:noCompletion public function start2() {
		trace("start2");
	}
}

Builder.hx

import haxe.macro.Context;

using Lambda;

class Builder
{
	public static function build() {
		var fields = Context.getBuildFields();
		var startField = fields.find(function(f) return f.name == "start");
		// Commenting out this line makes it work:
		startField.meta.push({name: ":noCompletion", params: [], pos: Context.currentPos()});
		return fields;
	}
}

haxe --display Main.hx@0 returns <list></list>, so that seems to work.

@clemos
Copy link
Owner

clemos commented Feb 10, 2017

Isn't this a feature :p ?
In any case, I guess it should be reported to the compiler, shouldn't it ?

@ciscoheat
Copy link
Author

Yes, it seems to work, I got it confused with the same issue for Haxedevelop. But I see now that there is no autocompletion for startField inside Builder.hx.

import haxe.macro.Context;

using Lambda;

class Builder
{
	public static function build() {
		var fields = Context.getBuildFields();
		fields.| // autocompletion for array works fine
		var startField = fields.find(function(f) return f.name == "start");
		startField.meta.push({name: ":noCompletion", params: [], pos: Context.currentPos()});
		startField.| // no autocompletion, no error
		return fields;
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants