Skip to content

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

Description

@ciscoheat

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions