Editor: CodeLens + completion to scaffold Vega-Lite params; shared snippet core

This commit is contained in:
2026-07-02 22:15:50 +03:00
parent c5e4c4c76d
commit e42a535726
15 changed files with 1160 additions and 281 deletions
+11
View File
@@ -54,6 +54,10 @@ import {
configureSpecTransformScaffold,
installSpecTransformScaffoldCodeLens,
} from '../services/spec-transform-scaffold';
import {
configureSpecParamScaffold,
installSpecParamScaffoldCodeLens,
} from '../services/spec-param-scaffold';
import { runExtract } from '../services/extract-action';
import { useAppStore } from '../stores/AppStore';
import { confirm } from '../stores/ConfirmStore';
@@ -179,6 +183,8 @@ configureSpecDatasetHints();
configureSpecExpressionHints();
// Register the data-transform step-scaffold completion once (docs/architecture/08).
configureSpecTransformScaffold();
// Register the parameter-scaffold completion once (docs/architecture/08).
configureSpecParamScaffold();
/** The two spec↔config operations, surfaced as an overflow menu (council:
* Carbon menu-buttons — overflow for additional options under space
@@ -466,6 +472,10 @@ export function SpecEditor() {
// — per editor for the same reason: its commands drive this editor's snippet edit.
const scaffoldLensSub = installSpecTransformScaffoldCodeLens(editor);
// Cursor-aware parameter scaffold CodeLens ( slider / point …) — per editor,
// its command splices the seeded param into this editor via the snippet engine.
const paramScaffoldLensSub = installSpecParamScaffoldCodeLens(editor);
// Validate Vega expressions in the draft and squiggle the invalid ones — per
// editor, because it writes markers to this model (docs/architecture/08).
// Debounced internally; recomputes on edit and on a draft↔published toggle.
@@ -483,6 +493,7 @@ export function SpecEditor() {
transformActionsSub.dispose();
codeLensSub.dispose();
scaffoldLensSub.dispose();
paramScaffoldLensSub.dispose();
exprMarkersSub.dispose();
editor.dispose();
editorRef.current = null;