Skip to content

Exclude syntax info's origin from its hash code#8502

Merged
APickledWalrus merged 4 commits intodev/patchfrom
patch/fix-syntax-info-hash
Mar 27, 2026
Merged

Exclude syntax info's origin from its hash code#8502
APickledWalrus merged 4 commits intodev/patchfrom
patch/fix-syntax-info-hash

Conversation

@UnderscoreTud
Copy link
Copy Markdown
Member

Problem

When registering an element without defining its origin, Skript will automatically apply an origin to it pointing to the addon that registered it. That's extremely useful but unfortunately means that the syntax info that Skript registers isn't the same as the one provided by the addon, due to the origin being included in the hash code, thus having different hashes. Which in turn means that, when the addon tries to unregister the same info later on, Skript won't be able to find and unregister it.

Solution

Exclude the origin from the hash, since it's not part of the syntax info's properties. Which also aligns with how the equals method is currently implemented. (origin is excluded)

Testing Completed

Added a test case in SyntaxRegistryTest.java for unregistering elements with different origins

Supporting Information


Completes: none
Related: none
AI assistance: none

@UnderscoreTud UnderscoreTud requested review from a team and APickledWalrus as code owners March 14, 2026 17:08
@UnderscoreTud UnderscoreTud added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Mar 14, 2026
@UnderscoreTud UnderscoreTud requested review from Efnilite and removed request for a team March 14, 2026 17:08
@sovdeeth sovdeeth moved this to In Review in 2.15 Releases Mar 23, 2026
@github-project-automation github-project-automation bot moved this from In Review to Awaiting Merge in 2.15 Releases Mar 23, 2026
@skriptlang-automation skriptlang-automation bot added the patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. label Mar 23, 2026
@APickledWalrus APickledWalrus merged commit fc37848 into dev/patch Mar 27, 2026
9 checks passed
@skriptlang-automation skriptlang-automation bot added the completed The issue has been fully resolved and the change will be in the next Skript update. label Mar 27, 2026
@APickledWalrus APickledWalrus deleted the patch/fix-syntax-info-hash branch March 27, 2026 18:27
@skriptlang-automation skriptlang-automation bot removed the patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. label Mar 27, 2026
@github-project-automation github-project-automation bot moved this from Awaiting Merge to Done - Awaiting Release in 2.15 Releases Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update.

Projects

Status: Done - Awaiting Release

Development

Successfully merging this pull request may close these issues.

4 participants