Skip to content

add: Script.java record to encapsulate script paths#23

Open
3add wants to merge 4 commits into
SkriptDev:dev/featurefrom
3add:fix/scripts-referred-with-name
Open

add: Script.java record to encapsulate script paths#23
3add wants to merge 4 commits into
SkriptDev:dev/featurefrom
3add:fix/scripts-referred-with-name

Conversation

@3add
Copy link
Copy Markdown

@3add 3add commented May 31, 2026

fix: scripts with the same name in different directories colliding
fix: memory leak when removing functions in Functions#removeFunctions(Script)
deprecated: all methods using the old string-based scriptName system
removed: some unused imports
add: Script class, tracking loaded scripts

fix: scripts with the same name in different directories colliding
fix: memory leak when removing functions in Functions#removeFunctions(Script)
deprecated: all methods using the old string-based scriptName system
removed: some unused imports
Copy link
Copy Markdown
Member

@ShaneBeee ShaneBeee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first glance, this looks good.
thanks for doing this. I planned on doing it but also really didn't want to haha.

Just a few tiny nitpicks

Comment thread src/main/java/io/github/syst3ms/skriptparser/parsing/Script.java
Comment thread src/main/java/io/github/syst3ms/skriptparser/parsing/Script.java
@3add
Copy link
Copy Markdown
Author

3add commented May 31, 2026

Crap, I just noticed everything in the file package also references just using their name. I'll work on that later.

…ng them of course (and the test)

refactor: FileElement.java, alt+shift+l

also the "fileName" wasn't even fileName here, it was Path#toString so fixing that is also nice
@3add
Copy link
Copy Markdown
Author

3add commented May 31, 2026

Turns out that one wasn't bugged since it was using Path#toString, I still updated it to be consistent

@@ -46,15 +71,27 @@ public static List<LogEntry> loadScript(Path scriptPath, boolean debug) {
*/
public static List<LogEntry> loadScript(Path scriptPath, SkriptLogger logger, boolean debug) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should make this return a Pair<Script, List<LogEntry>> since this method should also return the created Script object. Wdyt

@3add 3add requested a review from ShaneBeee June 1, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants