v0.5.0 — withdraw v0.4.2 alias preamble; ship visible scaffolding + smart CS0104 hints
Breaking change (justifies the minor-version bump): IComBridgePlugin.ScriptUsingAliases removed. Plugins built against v0.4.2 that relied on the preamble mechanism need rebuilding against v0.5.0; the four Office plugins shipped in this repo are already updated.
Why withdraw v0.4.2
The v0.4.2 mechanism injected using Xl = global::...; into the script source before Roslyn compiled it. That solved CS0104 — but at app-store scale (thousands of plugins, thousands of authors, public ScripTree catalog), invisible source rewriting breaks more than it fixes:
- External IDEs (VS Code, Rider, Cursor) can't see the preamble → red squiggles on working scripts
- LLMs reading the .csx in isolation hallucinate where
Xlcame from - App-store auditors can't evaluate published scripts without learning host internals
- Roslyn diagnostic-format changes could silently break line-number remap
- "Rewrite the script before compile" is a category of mechanism that grows
The savings (1 line of typing per script, amortized away by templates anyway) didn't justify those costs.
What ships in v0.5.0
Two visible tools that solve the same problem without host-side rewriting:
<plugin> new-script <path> [--force]
Scaffolds a starter .csx with the alias line, available globals documented in a header comment, and a minimal example body. The alias is right there in the source file — every reader sees what's in scope.
combridge excel new-script my_thing.csx
combridge word new-script my_thing.csx
combridge powerpoint new-script my_thing.csx
combridge outlook new-script my_thing.csx
Smart CS0104 hints
If you forget the alias and hit error CS0104: 'Range' is an ambiguous reference between ..., the host detects the Office-interop / BCL collision pattern and appends a hint:
collision_test.csx(2,1): error CS0104: 'Range' is an ambiguous reference between 'Microsoft.Office.Interop.Word.Range' and 'System.Range'
-> Hint: add this to the top of your script:
using Wd = global::Microsoft.Office.Interop.Word;
then use 'Wd.Range' instead of bare 'Range',
or qualify the BCL side as 'System.Range'.
See LLM/scripting.md for the full collision table.
Original diagnostic preserved verbatim — including the author's actual line/column span. No source rewriting, no remapping.
Removed
IComBridgePlugin.ScriptUsingAliasesScriptHost's preamble injectionScriptHost.DetectEncoding+RemapDiagnosticLine+DiagLocRxScriptUsingAliasesoverrides on the four Office plugins
Added
ScriptScaffold.WriteTemplatehelper inComBridge.Core(shared by allnew-scriptcommands)NewScriptCommandon each Windows Office pluginScriptHost.AugmentOfficeDiagnostic(additive, no source mutation)
See CHANGELOG.md v0.5.0 entry for full implementation detail; see FeatureRequests/ComBridge_FeatureRequests/Rejected/FR_office_script_interop_alias.md for the rejection rationale and lessons-captured note.