SpyglassMC / Spyglass

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

Add support for deprecated mcdoc types #1605

Open misode opened 1 month ago

misode commented 1 month ago

It is useful to mark certain mcdoc types as deprecated, especially in the context of vanilla-mcdoc. On the one hand we want to keep that repository up-to-date with modern schema names and structures, but on the other hand people are relying on these types to describe their own custom mcdoc types. Since there is no versioning for vanilla-mcdoc, Spyglass automatically downloads and uses the latest version. We need to make sure that existing, frequently used types (within reason) stay available, but still mark them as deprecated so users move away from them.

I propose the following syntax to mark mcdoc types as deprecated:

/// @deprecated Use ::java::server::world::item::ItemStack instead
type InventoryItem = ItemStack

Note that this is not the same as the #[deprecated] attribute, which is a runtime deprecation warning. This proposal would mark mcdoc types in source as deprecated.