Skip to content

Reimplement VS Code extension LSP client in AffineScript (blocked on estate ABI/FFI layer) #78

Closed

Description

@hyperpolymath

Context

The VS Code extension's LSP client was previously implemented in ReScript, which is banned estate-wide (language policy → AffineScript). It was removed in #77 (PR), reducing editors/vscode/ to passive language support (TextMate grammar + language-configuration.json). Zero .res files now remain.

The intended reimplementation language is AffineScript (estate-primary). However, a faithful client cannot be written yet:

  • AffineScript has no host-FFI / extern mechanism — there is no way to call the VS Code extension-host JS APIs (vscode.workspace.getConfiguration, vscode-languageclient's LanguageClient, command registration, etc.).
  • AffineScript compiles to WASM, not the Deno/Node JS host a VS Code extension runs in.
  • No real .af sources or in-repo compiler exist yet (the language is specification-first).

This work is therefore blocked on the planned estate ABI/FFI layer (tracked in hyperpolymath/nextgen-languages ROADMAP as the Idris2 + Zig interop work).

What to restore (parity with the removed ReScript client)

Driving the existing Rust woke-lsp server, the client provided:

  • Activation on onLanguage:wokelang; start/stop the LanguageClient over stdio, server path from wokelang.serverPath (default woke-lsp).
  • Commands: wokelang.restartServer, wokelang.showInfo, wokelang.checkConsent, wokelang.formatDocument.
  • Keybindings: ctrl/cmd+shift+f (format), ctrl/cmd+shift+c (consent check); editor-context menu entries.
  • Settings: wokelang.serverPath, wokelang.enableDiagnostics/Completion/Hover/Formatting, wokelang.trace.server.

These manifest contributions were stripped from package.json and should be re-added alongside the client implementation.

Acceptance

  • Estate ABI/FFI layer provides a usable JS-host binding path for AffineScript (prerequisite — link the enabling issue when it lands).
  • Client authored in AffineScript, compiled to an extension-host module, wired back into package.json (main, activationEvents, contributes.commands/menus/keybindings/configuration).
  • Passes the governance gate (no banned-language files) and the extension loads + connects to woke-lsp.

Notes

  • The woke-lsp Rust server is unaffected and continues to build (cargo build --bin woke-lsp); any LSP-capable editor can use it directly in the meantime.
  • If AffineScript host-FFI proves infeasible long-term, the policy's documented fallback ("JavaScript — only where AffineScript cannot") is the alternative — to be decided by the maintainer at that point.

Filed while shepherding #77 through the CI gate; the ReScript removal there closed the governance banned-language failure.

Activity

  1. hyperpolymath commented on Aug 24, 2026

    @hyperpolymath
    OwnerAuthor

    Resolved in PR restoring JS fallback LSP client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions