Add semantic model AI metadata scripts#31
Conversation
| var type = assembly.GetType("ScintillaNET.Scintilla", true); | ||
| var control = (Control)Activator.CreateInstance(type); | ||
| ConfigureScintilla(control, lexerName, wordWrap); | ||
| return new ScriptTextEditor(control, null, wordWrap); |
There was a problem hiding this comment.
(Applies to linse 356-362)
On my machine, I could not get Scintilla to load this way. Most likely because the assembly name is Scintilla.NET (with a dot). But even if I fix that, Scintilla still doesn't syntax highlight markdown/JSON the way that was probably intended.
I suggest removing everything related to Scintilla from these scripts, and just always rely on default Winforms textbox (like the fallback below). This should also make the script work in TE2 and make it less brittle, in case we move away from Scintilla in a future update of TE3.
There was a problem hiding this comment.
Note, there's lot of Scintilla specific configuration code (which also uses reflection) further down in the script. That should be trimmed out as well.
| if (helperType == null) return false; | ||
|
|
||
| var method = helperType.GetMethod("ImportCulture", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); | ||
| if (method == null) return false; |
There was a problem hiding this comment.
(applies to lines 265-269)
It's OK to keep this in, even though it's technically accessing internals, there's an argument to be made that the ImportCulture method should be available for the public scripting API. I've added this to our internal backlog. Once that's implemented, we can then update this script to use the public surface instead of reflection.
| var type = assembly.GetType("ScintillaNET.Scintilla", true); | ||
| var control = (Control)Activator.CreateInstance(type); | ||
| ConfigureScintilla(control, lexerName, wordWrap); | ||
| return new ScriptTextEditor(control, null, wordWrap); |
There was a problem hiding this comment.
same comment as for the AI Instructions script; let's avoid using Scintilla (and trim down the Scintilla config code in this script), and just rely on the standard WinForms TextBox instead.
|
@otykier Done, ready for re-review. |
Adds a Semantic Model AI Metadata folder with three C# scripts: non-interactive AI metadata management, TE3 AI instructions editor, and TE3 AI schema editor. Includes README usage docs and top-of-file script documentation. Validation: git diff --cached --check.