All Imports used in JaninoScript implementations (param types/return types) are now passed implicitly to ScriptDocument to store for when hook stubs are generated/hooks are manually added

This commit is contained in:
bigguy345 committed 2026-01-14 03:02:15 +02:00
1 parent 165e3e2d14
commit 26a9c99000
5 files changed
+255 -8

No files matched your search

@@ -2652,6 +2652,18 @@ public class GuiScriptTextArea extends GuiNpcTextField {
return this.container != null ? this.container.getScriptContext() : ScriptContext.GLOBAL;
}
/**
* Add implicit imports that should be resolved without explicit import statements.
* Used for JaninoScript default imports and hook parameter types.
*
* @param patterns Array of import patterns to add (wildcard packages like "noppes.npcs.api.*" or FQ class names)
*/
public void addImplicitImports(String... patterns) {
if (this.container != null) {
this.container.addImplicitImports(patterns);
}
}
public void setListener(ITextChangeListener listener) {
this.listener = listener;
}
@@ -2797,7 +2809,13 @@ public class GuiScriptTextArea extends GuiNpcTextField {
selection.reset(savedCursorPos + cursorAdjustment);
scrollToCursor();
}
public void formatCodeText() {
if (this.enableCodeHighlighting && this.container != null) {
this.container.formatCodeText();
}
}
/**
* Helper class for tracking imports during sorting.
*/