minecraft-dev / MinecraftDev

Plugin for IntelliJ IDEA that gives special support for Minecraft modding projects.
https://minecraftdev.org/
GNU Lesser General Public License v3.0
1.52k stars 186 forks source link

Add json5 support to mixin config jsons #2375

Closed Bawnorton closed 2 months ago

Bawnorton commented 2 months ago

Allow mixin config json inspections and references to recognise mixin configs of the json5 file type

Motivation

Stonecutter, a gradle pre-processor plugin has been gaining traction for it's use in multi-loader, multi-version projects, and a plugin that was developed alongside it, j52j, which converts json5 files to json during compilation allowing versioned comments within json files resulting in json5 being used as the file type for a mixin config:

https://github.com/Bawnorton/BetterTrims/blob/8558c398e0cd5a85fdd5dce6b2ed9e410d239743/src/main/resources/bettertrims.mixins.json5#L6-L12

mcdev doesn't recognise json5 as a valid file type for mixin config jsons, so this pr adds that support.

Bawnorton commented 2 months ago

I tested that initially and it causes a json language inspection in the mixin json for violating the json standard as the config file type specifies that the language is Json not Json5

Screenshot 2024-09-19 at 3 24 17 PM