Skip to content

v0.10.0

Choose a tag to compare

@github-actions github-actions released this 17 May 23:53
· 54 commits to main since this release
  • qvr repl is a GHCi-style four-pane Textual TUI with live syntax highlighting, an env browser, file-watcher auto-reload, a command palette, pinned watches, Tab completion, click-to-:info, and click-to-$EDITOR footers.
  • qvr-lsp is a full LSP 3.17 language server (hover, definition, references, document symbols, semantic tokens, completion, formatting, live diagnostics) consumed out of the box by VS Code, Cursor, Zed, and Neovim through the new editor extensions.
  • qvr-kernel runs ReplSession from Jupyter notebooks.
  • One STYLE_TABLE and one completer feed each of the above, so colors and suggestions never disagree.

Added

  • qvr repl: GHCi-style interactive type explorer. Four-pane Textual TUI (top status bar; input editor with bracket pairing and auto-indent; eval log with live syntax highlighting; environment browser with namespace tree, fuzzy filter, and click-to-:info; auto-hiding watches and diagnostics strips), plus a prompt_toolkit single-line fallback (--plain / non-TTY). Meta-commands :load, :reload, :type, :kind, :info (--python opts in to the didactic AST), :doc, :browse, :dump (--json opts in to model_dump_json), :edit (opens $EDITOR and splices the result back), :trace, :save, :watch, :unwatch, :set, :help, :quit, with the short aliases GHCi users expect (:l, :r, :t, :k, :i, :b, :s, :w, :h, :q). Bare lines compile as appended statements into the live module or fall through to :type. Persistent input history at ~/.config/quivers/history (Ctrl-Up / Ctrl-Down walks it). Tab cycles through env, grammar-keyword, builtin, and path completions. Ctrl-P opens a Textual command palette over every meta-command. Ctrl-G / Ctrl-O / F8 evaluate; the bindings are picked to clear every layer of OS, terminal, XON/XOFF, and TextArea keymap interference on macOS, Linux, and Windows. Install with pip install 'quivers[repl]'.
  • Live syntax highlighting shared with the editor. A single STYLE_TABLE and tree-sitter-driven tokenizer (quivers.cli.repl_highlight) feeds the TUI's RichLog, the prompt_toolkit lexer, the Jupyter kernel's mimetype hint, and the LSP's semanticTokens/full legend. The tokenizer is env-aware: identifiers the grammar can't classify in an ERROR context are upgraded to the env-known kind (type / function / namespace), so the same name reads the same colour across every surface. Adding a keyword to grammars/qvr/grammar.js paints it everywhere automatically.
  • File-watcher auto-reload. The TUI polls the loaded file's mtime once per second and re-runs :reload when it advances, printing the diff. Pinned :watch expressions re-evaluate against the new env. Off via :set autoload_on_save=false.
  • Pinned watches. :watch EXPR adds EXPR to a dedicated panel (auto-hidden when empty) and re-evaluates after every recompile; :unwatch EXPR removes one, :unwatch alone clears all.
  • Click-to-info and click-to-edit. Identifiers in rendered eval-log output (anything the env classified as a type / function / namespace) are clickable links that fire :info NAME. The -- declared at PATH:LINE:COL footer underneath each :info body is also clickable; it launches $EDITOR +LINE PATH.
  • Inline diagnostic markers. Compile, parse, and constraint errors that carry a known location move the input pane's cursor selection to the offending span so the user sees where to look without leaving the editor.
  • Jupyter kernel. qvr-kernel install (or qvr kernel install) registers a quivers kernelspec whose cell evaluator is the same ReplSession driving the REPL. Cells with a leading : dispatch to meta-commands; blank lines split independent statement chunks within a cell. Tab-completion (do_complete) and Shift-Tab inspect (do_inspect → :info) share the REPL's completer and renderer. The kernelspec advertises pygments_lexer: qvr so notebook frontends highlight cells via the bundled Pygments lexer.
  • qvr-lsp: Language Server (LSP 3.17). pygls 2.x server with incremental document sync, publishDiagnostics (parser + constraint solver + compiler with source ranges), semanticTokens/full (driven by the shared STYLE_TABLE), hover (QVR declaration sliced verbatim from the original source plus the didactic AST stacked beneath under a collapsed <details>, pretty-printed one field per indented line), definition, references, documentSymbol (Class for objects/spaces, Function for morphisms, Variable otherwise), completion (same engine as the REPL), and formatting (canonical re-emission via module_to_source). Install with pip install 'quivers[lsp]'. New console scripts qvr-lsp and qvr-kernel; new subcommands qvr repl, qvr lsp, qvr kernel.
  • First-party VS Code / Cursor extension. editors/vscode-qvr (v0.5.0) bundles a vscode-languageclient bridge to qvr-lsp plus the existing TextMate grammar. Auto-discovers the server in (1) qvr.lsp.path (with ${workspaceFolder} expansion), (2) <workspace>/.venv/bin/qvr-lsp, (3) <workspace>/.venv/Scripts/qvr-lsp.exe, (4) $VIRTUAL_ENV/bin/qvr-lsp, (5) $PATH. Configurable via qvr.lsp.enabled, qvr.lsp.path, qvr.lsp.args.
  • First-party Zed extension wiring. editors/zed-extension-qvr adds qvr-lsp as a language_server entry; Zed spawns it automatically on .qvr files.
  • :save FILE meta-command. Writes the live module (including any statements appended in the session) back to disk via module_to_source. Defaults to the loaded path when no argument is given.
  • Optional dependency groups. [repl] (Textual, prompt_toolkit, rich, ipykernel, jupyter_client) and [lsp] (pygls, lsprotocol). pip install quivers alone keeps the core dependency list unchanged — none of the interactive tooling is mandatory.
  • Comprehensive interactive guide. New guides/repl-and-lsp.md covers every meta-command, every keybinding (with the cross-platform reasoning), the layout, the file watcher, semantic highlighting, themes, the Jupyter kernel, the LSP capabilities, and per-editor wiring instructions. Cross-linked from the README, docs/index.md, getting-started/installation.md, getting-started/quickstart.md, and getting-started/highlighting.md.

Changed

  • panproto bumped to >=0.47.3 and panproto-grammars-all to >=0.47.3. The current QVR tree-sitter grammar (with the alias, export, program, kernel-decl forms) is now vendored upstream; the local-grammar override (QVR_USE_LOCAL_GRAMMAR=1) is no longer necessary for either the runtime or the CI test suite.

Fixed

  • pygls 2.x API migration. LanguageServer.publish_diagnostics was removed upstream in favour of text_document_publish_diagnostics(PublishDiagnosticsParams(...)). The previous call surfaced as an AttributeError dialog in VS Code on every save.

Full Changelog: v0.9.1...v0.10.0