SpyglassMC / Spyglass

Development tools for vanilla Minecraft: Java Edition data pack developers.
https://spyglassmc.com
MIT License
300 stars 31 forks source link

False errors in older pack versions #1432

Closed Kesuaheli closed 2 months ago

Kesuaheli commented 2 months ago

I have datapacks with pack_format 10 (1.19) and 26 (1.20.3).

Both of them suddenly have errors. One with particle dust beeing wrong. And one with give @s <item>{WithSomeNBT: {}} beeing wrong.


image Two errors here (on two positions):

Expected a compound tag     spyglassmc
Trailing data encountered: “~ .25 1 .25 .2 100” spyglassmc

image Two errors here (on one position):

Expected a space (“ ”)      spyglassmc
Expected <count: integer>   spyglassmc

These packs obviously work in their desired version

misode commented 2 months ago

The extension only supports loading a single version at once, but it looks like it isn't detecting any of those two versions correctly. If you open the output panel (Ctrl+Shift+U), select "Spyglass Language Server", and scroll up, you should be able to see a line "Found valid pack.mcmeta ..." highlighting what pack.mcmeta file it detected and which pack format

Kesuaheli commented 2 months ago

Well... [je.initialize] Failed finding a valid pack.mcmeta

I tried open just a single datapack and it found it. But for the whole workspace containing multiple levels of different worlds with datapacks/ folders it cant find any pack.mcmeta

misode commented 2 months ago

It only searches two folders deep to find a pack.mcmeta

If you really want to have this whole folder open at once, you can manually set a version in spyglass.json at the root of the workspace:

{
  "env": {
    "gameVersion": "1.20.3",
  }
}
Kesuaheli commented 2 months ago

Yeah, have to do that then.

Is there a reason it only searches 2 folders? Or is it just performance. Preventing to potentially go through dozens of folders just to eventually find there is actually no pack.mcmeta anywhere. If so: Well, I thought a simple file search was more efficient ^^ But would it be an idea make that (im assuming hardcoded) "2 folders deep" into a config option?

misode commented 2 months ago

It was a config option in v3, but tbh the real solution will be supporting multiple versions, and then it will just use the right version within each pack.mcmeta data pack

Kesuaheli commented 2 months ago

So this will be fixed by

right?

misode commented 2 months ago

Yes. It'll mark it as a duplicate