Skip to content

[Suggestion] Auto-Completion Of Mixin Self-Reference #447

@ChloeDawn

Description

@ChloeDawn
Minecraft Development for IntelliJ 2018.2-1.2.9
IntelliJ IDEA 2018.2.2 (Community Edition)
Build #IC-182.4129.33, built on August 21, 2018
Windows 10 10.0

Auto-completion intentions when referencing this in the context of a @Mixin annotated class.

@Mixin(AClass.class)
public final class MixinAClass {
	public void aMixinMethod(...) {
		this; // referencing MixinAClass

		// Whilst typing "this", a completion suggestion would be available for:

		(AClass) (Object) this; // referencing AClass
	}
}

Additionally, folding of (AClass) (Object) this to AClass.this could be nice.
EDIT: I just noticed cast folding exists already, my bad. However, I do think my approach to it would be more semantically correct - folding it as a reference to the enclosing class, which is what the mixin target is treated as in most cases.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions