Skip to content

Refactor#149

Open
owjs3901 wants to merge 33 commits into
mainfrom
refactor
Open

Refactor#149
owjs3901 wants to merge 33 commits into
mainfrom
refactor

Conversation

@owjs3901
Copy link
Copy Markdown
Contributor

No description provided.

owjs3901 added 30 commits May 20, 2026 16:02
impl parallel
impl erd svg
# Conflicts:
#	.gitignore
#	Cargo.lock
Two audit documents recording the Wave 10 and follow-up work:

- PERFORMANCE-AUDIT.md: planner diff -44%% via Vec capacity hints + BTreeSet adjacency + index-lookup sort

- PERFORMANCE-AUDIT-FOLLOWUP.md: SeaORM FK target cache + entity_count optimization (1.08x-1.90x on new benches); Task D reverted; skipped items documented
Empty .gitkeep files reserve apps/vscode-extension/ and apps/zed-extension/ for Session B scaffolding (VSCode + Zed extensions). LICENSE already at workspace root satisfies Zed's Oct 2025 license requirement.
Pure data layer for the LSP — no LSP handlers yet:

- ParserPool wraps tree-sitter-json + tree-sitter-yaml in Mutex<Parser>

  (Parser is !Send; V1 full reparse is fine for <5KB model files)

- DocumentState couples FullTextDocument (UTF-16-aware) with Tree

- DocumentStore is a DashMap<Uri, DocumentState> — justified hot path

  exception to BTreeMap policy; documented inline

- Backend now holds Arc<DocumentStore>; handlers come in W2-T2

lsp-textdocument 0.5 uses upstream lsp_types 0.97 directly (distinct from

tower-lsp-server's re-exported ls_types), so lsp-types is pulled in as a

direct dependency for change-event construction at the data layer.
…kspace index

- position.rs: UTF-16 <-> byte offset + ls_types <-> lsp_types bridges

- workspace_index.rs: BTreeMap<table_name, Uri> via tree-sitter walk

- store.rs: with_doc() accessor returning (text, tree)

- backend.rs: did_open/did_change/did_close handlers + reindex helper

Property-style position tests cover CJK + emoji surrogate pairs.
- diagnostics/ module is LSP-types-free domain layer

- 3-tier validation: tree-sitter syntax → serde parse → planner validate_schema

- mapper translates DomainDiagnostic → ls_types::Diagnostic at I/O seam

- Backend wires publish on did_open/did_change, clears on did_close

- Diagnostic codes: syntax-error, parse-error, validate-schema
- hover/: column metadata + FK target preview markdown

- definition/: cross-file FK ref_table → target file location

- Backend declares hover_provider + definition_provider

- All domain modules LSP-types-free; bridges in position.rs
…e refs)

- completion/ module is LSP-types-free domain layer

- Context detection via tree-sitter key path ancestry

- Hardcoded vespertide schema knowledge (V1; V2 may read schemas.json)

- Cross-file ref_columns: deserialize target table, list its columns

- Sort priority follows sqls pattern (specific > generic)

- New backend handler + completion_provider capability
Drift detection — unique to vespertide-lsp, no competitor offers this:

- Loads models + applied migrations via vespertide-loader

- Reconstructs baseline via schema_from_plans

- Diffs against current models; emits Info diagnostic per drifted table

- Pure file-based — no live DB connection required

Formatting:

- JSON: serde_json pretty (2-space indent), round-trip semantic equivalence

- YAML: serde_yaml default

- Falls through silently on parse errors (diagnostics surface those)
Triggers on tag push matching lsp-v* (or workflow_dispatch). Builds:

- linux-x86_64 / linux-aarch64 (via cross)

- darwin-x86_64 (macos-13) / darwin-aarch64 (macos-latest)

- windows-x86_64 (msvc)

Packages as tar.gz (Unix) or zip (Windows), with SHA256.

Uploads assets to the matching GitHub Release via softprops/action-gh-release@v2.

Consumed by Zed extension's latest_github_release() lookup.
Scaffolds apps/vscode-extension/ with:

- package.json: vscode-languageclient 9.0.1, esbuild 0.28, vsce 3.9

- engines.vscode ^1.105.0 (2026-05 baseline)

- contributes.languages: vespertide-json + vespertide-yaml with file glob patterns

- src/extension.ts: LSP client launch with stdio transport, binary resolver (vespertide.serverPath override -> bundled platform-specific binary)

- Commands: vespertide.restartServer

- Status bar item showing connection state

- Platform-specific binaries via bin/<platform>/ (populated by Session B Wave 9 CI)

- DevFive-branded README
Scaffolds apps/zed-extension/ as a standalone crate (NOT workspace member):

- Cargo.toml: cdylib + zed_extension_api 0.7.0, edition 2021 (Zed convention)

- workspace Cargo.toml: exclude = [\"apps/zed-extension\"] to preserve edition + target

- extension.toml: registers vespertide-lsp language server for JSON + YAML

- src/lib.rs: language_server_command + GitHub Release binary auto-download

  - PATH lookup -> cached binary -> download from latest GH Release

  - Cleans up old versions on update

  - Pure asset-matching unit test

- languages/{vespertide-json,vespertide-yaml}/config.toml: file associations

- LICENSE: Apache-2.0 (REQUIRED by Zed registry since Oct 2025)

- DevFive-branded README
Triggers on tag push matching vscode-v* (or workflow_dispatch with lsp_tag input).

5-platform matrix:

- Downloads matching vespertide-lsp asset from latest (or specified) lsp-v* GH Release

- Extracts to apps/vscode-extension/bin/<platform>/

- Builds via bun + esbuild

- Packages platform-specific .vsix via vsce

- Publishes to VS Code Marketplace (VSCE_PAT) + Open VSX (OVSX_PAT)

- Uploads .vsix to the vscode-v* GH Release for manual install
Documents three release channels with their tag patterns and workflows:

- lsp-v* -> cross-compile + publish 5 binaries to GH Release

- vscode-v* -> bundle binaries into platform-specific VSIX, publish to Marketplace + Open VSX

- zed-v* -> manual PR to zed-industries/extensions (with layout fallback)

Includes prerequisites, rollback procedures, and pre-release vs stable versioning convention.
Hardens vespertide-lsp's pure compute_* domain functions against

arbitrary byte input:

- compute_diagnostics / compute_hover / compute_definition

- compute_completion / format_text

Sweeps byte offsets and both JSON+YAML formats per input.

Wired into the existing nightly fuzz workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant