SpyglassMC / Spyglass

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

[Bug] IDE suddenly start failing #693

Closed oOBoomberOo closed 3 years ago

oOBoomberOo commented 4 years ago

This happens after I use the "Rename Symbol" feature to change the tag declaration boomber.potion_launcher.potion into boomber.potion_launcher.temp and then add a new tag declaration of boomber.potion_launcher.potion.

Full output log: https://pastebin.pl/view/b00b3547

The code (before):

#> boomber:potion_launcher/item/potion_launcher/impl/launch_potion/spawn
# @within boomber:potion_launcher/item/potion_launcher/impl/launch_potion

#>
# @private
#declare tag boomber.potion_launcher.potion

function boomber:potion_launcher/player/impl/direction_vector
data modify storage boomber:potion_launcher owner set from entity @s UUID

execute at @s anchored eyes run summon potion ^ ^ ^0.5 {Tags: ['boomber.potion_launcher.potion']}
    execute as @e[tag=boomber.potion_launcher.potion] run function boomber:potion_launcher/item/potion_launcher/impl/launch_potion/spawn_inner

The code (after):

#> boomber:potion_launcher/item/potion_launcher/impl/launch_potion/spawn
# @within boomber:potion_launcher/item/potion_launcher/impl/launch_potion

#>
# @private
#declare tag boomber.potion_launcher.temp

#>
# @within
#   boomber:potion_launcher/**
#declare tag boomber.potion_launcher.potion

function boomber:potion_launcher/player/impl/direction_vector
data modify storage boomber:potion_launcher owner set from entity @s UUID

execute at @s anchored eyes run summon potion ^ ^ ^0.5 {Tags: ['boomber.potion_launcher.temp', 'boomber.potion_launcher.potion']}
    execute as @e[tag=boomber.potion_launcher.temp] run function boomber:potion_launcher/item/potion_launcher/impl/launch_potion/spawn_inner
oOBoomberOo commented 4 years ago

Update: The problem persists after restarting VS Code but tied down to this specific project. It doesn't spill out error when opening any other datapack project.

SPGoding commented 3 years ago

The error spam seems to be caused by a @within boomber:p[ annotation 🤔

Not sure if clearing the cache (Ctrl + Alt + P, datapack.regenerateCache) would fix this. But anyways the old IMP-doc support is really hacky and unstable, which will be dropped after the current rewrite is finished and hopefully fix this issue.

(And sorry for the super late reply...)