Repository navigation
feat(editor): code completion from the SDK; ( writes the required name= parameters - #40
Merged
Merged
Conversation
… writes the required name= parameters, Tab moves between them - GET /api/sdk: the running package's public API (names, parameters, which are required, summaries) from inspect, for scad, scad.ql and scad.std.<module> - editor-web/src/lib/sdk-complete.ts: member completion (scad., scad.ql., ql., Q.), snippet on accepting a function or typing ( after a known name, name= completion inside calls (required first, above Python's builtins), Tab accepts a suggestion and then moves between parameters - the editor wrapper rebuilt its configuration on every render (new onChange / basicSetup each time), which drops a snippet in progress; both are stable now - popup styled to the editor's themes Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
NiJingzhe
added a commit
that referenced
this pull request
Oct 13, 2026
The completion entry (#40) had landed in the 2.2.1 section; both entries are under Unreleased now, with the editor-configuration fix. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The cell editor had no completion for the SDK: it is plain CodeMirror with the stock Python language support, which only knows Python keywords and names already in the file.
scad.is a runtime module, so nothing listed its functions, and a call's parameters had to be looked up elsewhere.What
GET /api/sdk(editor/apiindex.py): the running package's public API as data (name, kind, parameters with required/optional/*args/default, first docstring paragraph), read withinspectso it cannot drift from the code. Namespaces:scad,scad.ql,scad.std.<module>. About 100 KB (20 KB gzipped), fetched once.editor-web/src/lib/sdk-complete.ts(CodeMirror):scad.,scad.ql.,scad.std.gear.,ql./Q.list functions with their signature; the side panel shows every parameter with its default and the docstring.(after a known name, writes the call with every required parameter asname=placeholders:scad.make_box_rsolid(width=, height=, depth=). Tab moves to the next parameter (and accepts a highlighted suggestion first). Positional-only and*argsparameters get a hint placeholder.name=(required first, above Python's builtins).onChangeandbasicSetupobject each time), which drops a snippet in progress. Both are stable now (CellEditor,ModuleView).Checked
test/test_editor.py(newApiIndexTest: required parameters,*args, classes without private fields, namespaces, the endpoint): 43 passed.scad.make_box_r+ Tab ->width=, height=, depth=, then10Tab20Tab30->width=10, height=20, depth=30;scad.fillet_rsolid(typed by hand ->solid=, edges=, radius=;scad.ql.facandscad.std.gear.make_splist the right names;, boafter the required parameters offersbottom_face_center=first; accepting on an existing call changes only the name; dark and light.Not covered
selector.where(...)) and variables are not completed; only names reached throughscad,scad.ql/ql/Qandscad.std.<module>.scad,qlandQare recognized.