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

Add support for MixinExtras expressions #2274

Merged
merged 110 commits into from
Jul 12, 2024
Merged

Conversation

Earthcomputer
Copy link
Member

See Llama's gist for a (slightly outdated) overview of what MixinExtras expressions are. Without IDE support, ME expressions would be really inconvenient to write, more so than other mixin features.

ME expression syntax is support through a custom language in IntelliJ, through the use of language injection. To make this nicer to work with, I have slightly extended the ME expression language. Definitions are prefixed with the class keyword, and then a boolean literal for whether they are a type or not. Expressions are surrounded with do { ... }. For example:

@Definition(id = "Integer", type = Integer.class)
@Definition(id = "x", local = @Local(type = Object.class, ordinal = 0))
@Expression("(Integer) x")

would produce the following injected ME expression file:

class true Integer
class false x
do { (Integer) x }

This feature is basically done now, the only thing left is to switch away from the JitPack version of MixinExtras and use the library they'll provide for us, which will hopefully have the same interface.

Don't worry about the amount of commits, I'll squash them all on merge.

Earthcomputer and others added 30 commits January 20, 2024 22:39
# Conflicts:
#	src/main/resources/messages/MinecraftDevelopment.properties
LlamaLad7 and others added 16 commits July 9, 2024 21:14
Make the preview text more representative of the actual completion and support array literals which were previously missing.
Also adapt to related MixinExtras changes.
# Conflicts:
#	build.gradle.kts
#	src/main/kotlin/platform/mixin/inspection/injector/InvalidInjectorMethodSignatureInspection.kt
#	src/main/resources/META-INF/plugin.xml
#	src/main/resources/messages/MinecraftDevelopment.properties
# Conflicts:
#	src/main/kotlin/MinecraftConfigurable.kt
#	src/main/kotlin/MinecraftSettings.kt
#	src/main/resources/messages/MinecraftDevelopment.properties
@Earthcomputer Earthcomputer merged commit 6b0471e into dev Jul 12, 2024
8 checks passed
@Earthcomputer Earthcomputer deleted the mixinextras-expression branch July 12, 2024 20:16
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

Successfully merging this pull request may close these issues.

4 participants