feat(studio): GLSL editor autocomplete — generated builtin manifest + uniforms (M3)#105
Merged
Merged
Conversation
… uniforms (M3) Typing in the GLSL editor now offers completions: this shader's consumed uniforms (typed exactly as the generated uniform header declares them), the render entry snippet, vec/mat constructors, and every user-callable builtin — LPFN with full typed signatures and doc-comment descriptions, standard GLSL and texture builtins with name+arity snippets. Accepting inserts a snippet with navigable placeholders. Completions are generated from the compiler's builtin sources, never hand-authored (roadmap D5): - New generated leaf crate lps-builtin-completions (const manifest, emitted by lps-builtins-gen-app alongside the existing outputs; LPFN descriptions live as doc comments on the builtin sources, seeded once from the old web-demo list). - New lps_glsl::builtin_inventory: the compiler-INLINED builtin set (mix/clamp/dot/… — no BuiltinId, invisible to the mapping tables) declared as data beside the compiler, unit-tested against builtin_kind + check_builtin_arity; the generator consumes it. IR/VM internals are deliberately absent from the manifest. - Drift tests tie the manifest to BuiltinId::all(), the mapping tables, and the inventory — phantom or missing names fail the build. - Vendored CodeMirror bundle gains @codemirror/autocomplete (345.5 → 375.5 KB); the façade exposes a completions option + setCompletions behind a Compartment; CodeEditor gets a completions prop (diagnostics interop pattern). Empty list = no popup (plain/XML editors unchanged). - UiAssetEditor carries the shader's consumed uniforms, populated controller-side from the mirrored slot tree; glsl_type_for_lp_type exposed from lpc-model as the single type-name source; e2e-tested through the in-process server. Filetests byte-identical; generator regen deterministic; full gate green; live-verified in the sim (typed prefixes offer fbm overloads, the time uniform, and mix/min with spec param names). Plan: Planning/lp2025/2026-07-15-glsl-autocomplete/plan.md Co-Authored-By: Claude Fable 5 <[email protected]>
Yona-Appletree
added a commit
that referenced
this pull request
Jul 16, 2026
Brings in PR #105 (GLSL editor autocomplete — generated builtin manifest + uniforms) and PR #97 (device-link M5: native espflash-lib manage(), unified cli_connect, fwcheck/calibrate on shared abstractions). Conflicts: lpa-studio-core lib.rs export list — a pure union (this branch's binding-authoring types + main's UiShaderUniform); one story baseline PNG taken from main and re-captured in the follow-up commit. Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.
M3 of the glsl-editor-ux roadmap. Typing a prefix in the GLSL editor offers completions with real signatures; accepting inserts a snippet with navigable placeholders.
What completes
ShaderDef.consumed, typed exactly as the generated uniform header declares them (time — uniform float)float lpfn_fbm(vec2 p, int octaves, uint seed)), one entry per overloadmix(${x}, ${y}, ${a}))renderentry snippetNever hand-authored (D5)
The manifest is a new generated leaf crate (
lps-builtin-completions) emitted bylps-builtins-gen-app. Two compiler sources feed it: the BuiltinId mapping tables, and the newlps_glsl::builtin_inventory— the compiler-inlined set (mix/clamp/dot/…) declared as data beside the compiler and unit-tested against its ownbuiltin_kind/check_builtin_arity. Drift tests tie the manifest to both, so phantom or missing names fail the build. IR/VM internals are deliberately absent. LPFN descriptions live as doc comments on the builtin sources.Editor side
@codemirror/autocompleteadded to the vendored bundle (345.5 → 375.5 KB, +21.7 KB); façadecompletionsoption +setCompletionsbehind a Compartment;completionsprop onCodeEditorfollowing the diagnostics interop pattern. Empty list = the extension is absent, so plain/XML editors never grow a popup; existing ⌘↵/⌘S keymaps unaffected.Validation
lpfn_f→ typed fbm overloads,tim→ the time uniform,mi→ mix/minReview gate: live completion feel — worth a minute of typing in the sim before merge.
Follow-ups filed separately: GLSL error line-offset fix (naga prologue remap — chip filed), user functions/locals completion (needs compiler symbol info), GLSL-spec typed decoration for std builtins.
Plan:
Planning/lp2025/2026-07-15-glsl-autocomplete/🤖 Generated with Claude Code