SnaveSutit / origins-mod-json-schemas

MIT License
1 stars 1 forks source link

[BUG] Not working in IntelliJ IDEA #19

Open JosiahFu opened 6 months ago

JosiahFu commented 6 months ago

Describe the bug

I'm writing origins files alongside mod code, so I wanted to load the JSON schemas into IntelliJ IDEA. I tried adding the schemas as described in these jetbrains docs, but most things don't work properly. I don't know if this is an issue with the schemas, if VSCode just extends the schema definition, or if IntelliJ doesn't have full support for this, but could you check it out?

To Reproduce

  1. Create a datapack (or mod project)
  2. Open in IntelliJ IDEA
  3. Go to Settings > Languages & Frameworks > Schemas and DTDs > JSON Schema Mappings
  4. Press the + button
  5. Put in https://raw.githubusercontent.com/SnaveSutit/origins-mod-json-schemas/main/schemas/apoli/power.json for "Schema file or URL"
  6. Press the lower +
  7. Select "Add file path pattern
  8. Input **/data/*/powers/**.json

It should look like this: image

  1. Click "OK"
  2. Open an origin power file

Expected behavior

All descriptions and autocomplete should appear like in VSCode.

Screenshots

Descriptions not appearing image

No label appearing on string values image

Autocomplete/descriptions does work for universal properties at the top level (except type) and in condition

image image

Keybindings seem to cause issues

image

Markdown does not apply - this is definitely not your fault though

image

SnaveSutit commented 6 months ago

I have no clue why it wouldn't be working. VSCode only implements 1 custom feature, and that's the markdown_description field. That should just be ignored by Intellij

SnaveSutit commented 6 months ago

I think I can fix the markdown descriptions not being parsed issue though: #20

SnaveSutit commented 6 months ago

@JosiahFu FYI the schemas use JSON Schema version 7, so make sure you configure that as well. However, in my testing that doesn't seem to have fixed anything. But it for sure won't work on version 4.

JosiahFu commented 6 months ago

Yep, neither version worked completely

SnaveSutit commented 6 months ago

I'm also unable to find any information online where others have encountered such an issue, so until I can find someone who knows JSON schemas in Intellij I'm stuck.

JosiahFu commented 6 months ago

Alright, well thanks anyway for looking into it!