SpyglassMC / Spyglass

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

Add support for external/hosted supplementary symbolic data (eg. datapack libraries & modded mcdoc/mcmeta) #1297

Open MulverineX opened 2 weeks ago

MulverineX commented 2 weeks ago

essentially: git repositories/branches listed in workspace/global settings acting as dependencies for your project(s) that will automatically be fetched, cached, and updated by Spyglass, should also support local system paths

MulverineX commented 2 weeks ago

I'm adding this to 4.1 not because its super high priority, but because I'm committing to implement it for that release

misode commented 2 weeks ago

Ideally how this should work: we already have a dependencies list in the config containing by default @vanilla-datapack and @vanilla-mcdoc. A user should be able to put a url in there (or maybe a relative path). The dependency would be loaded and entered to the symbol table.

Extra care should be taken when validating relative paths (preventing path traversal) and we should maybe show a popup when attempting to download a URL for the first time.

MulverineX commented 2 weeks ago

Extra care should be taken when validating relative paths (preventing path traversal)

Eh IMO this should just be locked behind workspace trust and just be permissive. Definitions may be held at a completely different path on the system

Maybe have a warning the first time the path is traversing outside of the project root, similarly to the download confirmation

Relative ahead paths don't make a whole lot of sense here because the language server will pick up any directories in the workspace that have a pack.mcmeta/spyglass.json unless they are git ignored.