You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Codegen: add --vscode-extension flag to inline extraImports wiring (#116)
Closes#105.
The Node-CJS codegen emitted a shim with an empty extraImports hook that
every consumer hand-wired in a separate index.cjs to install the concrete
vscode-API bindings. That boilerplate was 100% mechanical and identical
across consumers.
Add a --vscode-extension codegen flag that inlines the wiring so the
generated .cjs is directly loadable as a VS Code extension's `main`:
installs exports.extraImports calling the @hyperpolymath/affine-vscode
adapter. Sub-flags --vscode-extension-adapter (override the require
specifier) and --vscode-extension-no-lc (no language client; pass null)
cover the documented variants.
Migrate the editors/vscode pilot off the would-be hand-written index.cjs:
its compile script now passes --vscode-extension and the regenerated
out/extension.cjs carries the inline glue; package.json declares the
adapter dependency.
https://claude.ai/code/session_01FkzAgzpZFSGxzorVNZ9FUF
Co-authored-by: Claude <noreply@anthropic.com>
for testing against a local checkout or vendoring a custom adapter.")
1174
+
1175
+
let vscode_no_lc_arg =
1176
+
Arg.(value & flag & info ["vscode-extension-no-lc"]
1177
+
~doc:"With --vscode-extension, omit the vscode-languageclient/node \
1178
+
dependency for extensions that ship no language client; the \
1179
+
wiring passes null in its place.")
1180
+
1144
1181
(** Shared --face flag: select the parser surface-syntax face. *)
1145
1182
let face_arg =
1146
1183
let faces =Arg.enum [
@@ -1486,7 +1523,9 @@ let repl_cmd =
1486
1523
let compile_cmd =
1487
1524
let doc ="Compile a file to WebAssembly (1.0 or GC proposal), Julia (.jl), JavaScript (.js), C (.c), a WGSL compute kernel (.wgsl), a Faust DSP program (.dsp), or an ONNX model (.onnx)"in
0 commit comments