SpyglassMC / Spyglass

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

Parse files opened from cache #1483

Open jacobsjo opened 2 months ago

jacobsjo commented 2 months ago

When following a reference to a vanilla file, the file is opened from the cache folder. It would be helpful if those files were also parsed by Spyglass to allow following references in them.

This is maybe most relevant with placed features. When following a reference to a placed feature in a biome file, it is often of interest to navigate to the configured feature file referenced by the placed feature.

SPGoding commented 2 months ago

Those files should already be parsed since normalizeUri() in Project maps the cache URIs to the logical URIs. One case I can think of where this might not work is opening the cache files directly after you restart VS Code since the mapping is only stored in memory.

jacobsjo commented 2 months ago

Doesn't seem to work for me. When following references, the opened json file doesn't get any yellow references, hover info etc.

SPGoding commented 2 months ago

Oh we need to remove these checks in Project or change them to check for all supported URI schemas: https://github.com/SpyglassMC/Spyglass/blob/main/packages%2Fcore%2Fsrc%2Fservice%2FProject.ts#L869

Sorry I forgot I only changed them on a feature branch