verso-v1.0.18
·
131 commits
to main
since this release
Release introducing an interactive verso repl command, supervised kernel restart in the VS Code extension, expanded Polyglot Notebook compatibility on Jupyter import, third-party extension loading from a configured directory, a structured VS Code logging channel, and quality-of-life fixes around variable substitution and NuGet reference tracking.
New: verso repl Command
- New
replsubcommand launches an interactive REPL session backed by the same kernel infrastructure used by notebooks - Two prompt drivers:
PrettyPromptDriverfor capable terminals (history, multi-line editing, syntax highlighting, completion via Roslyn callbacks) andPlainPromptDriveras a fallback for restricted terminals MinimalHighlighterprovides offline syntax highlighting for C#/F#/PowerShell tokens;KernelPromptCallbacksbridges Roslyn completions and signature help into the promptMimeDispatcherand renderer set (PlainTextRenderer,MarkdownRenderer,JsonRenderer,CsvTableRenderer,HtmlStripRenderer,ImagePlaceholderRenderer) translate kernel outputs to terminal-friendly forms withTruncationPolicy- Meta-command set (prefixed with
.):.clear,.convert,.exit,.export,.help,.history,.kernel,.layout,.list,.load,.md,.recall,.rerun,.reset,.save,.set,.theme,.vars,.view ReplSession,ReplLoop, andReplOptionsorchestrate the session;ReplSettingsandReplSettingsLoaderresolve user preferences from a settings fileSignalHandlertrapsCtrl+Cto interrupt running cells without exiting the session;HistoryStorepersists prompt history across sessionsTerminalCapabilitiesprobes for color/Unicode support so the REPL degrades gracefully on minimal terminals- New
ToolbarActionResolverfactored out ofExportCommandresolvesExportMenutoolbar actions and themes byDisplayName(case-insensitive) withActionId/ThemeIdfallback, shared by bothverso exportand the REPL.exportmeta-command - Spectre.Console and PrettyPrompt added to
THIRD-PARTY-NOTICES.md
New: Supervised Kernel Restart
Scaffoldexposes aHostRestartHandlerso an external supervisor (e.g. the VS Code extension) can fully tear down and respawn the host process when the user clicks Restart Kernel — addresses the Windows DLL-locking issue where in-process disposal could not release pinned assembly handles- New
kernel/restartRequested,kernel/restarting, andkernel/restartedJSON-RPC notifications coordinate the restart lifecycle between host, bridge, and webview - VS Code
BlazorEditorProviderimplements the full sequence: capture an in-memory notebook snapshot vianotebook/save, gate webview requests, dispose the host, spawn a new one, reopen the notebook, and drain queued requests against the new host BlazorBridgequeues incomingjsonrpc-requestmessages while a restart is in flight and routeskernel/restartRequestednotifications (including those raised by#!restartcells) through the same provider sequenceRemoteNotebookServicehandleskernel/restarting,kernel/restarted, andlayout/missingnotifications and exposesOnKernelRestarting,OnKernelRestarted, andOnLayoutMissingeventsNotebookPageshows a persistent status banner during the restart, clears execution badges and the variable inspector when the new kernel is ready, and keeps cell sources and outputs visible throughout
New: Missing-Layout Banner
LayoutManagerrecordsMissingLayoutIdand exposes aTryActivatemethod instead of throwing when a notebook references an unregistered layout — common when the layout ships in an extension that has not yet loadedNotebookHandleremits alayout/missingnotification with the unresolved id; the WASMNotebookPagesurfaces it as a non-fatal banner directing the user to run the#!extensionor#!nugetcell that registers the layout- Default layout activates so the notebook stays interactive while the user resolves the missing extension
New: Polyglot Notebook Language Switching on Jupyter Import
- New
JupyterPolyglotPostProcessortranslates Polyglot language-switching directives in imported.ipynbfiles into the right cell types, so notebooks authored in Polyglot Notebooks open without "Unknown magic command" failures at run time - Recognized switchers:
#!csharp/#!cs/#!c#,#!fsharp/#!fs/#!f#,#!pwsh/#!powershell,#!python/#!py,#!javascript/#!js,#!typescript/#!ts,#!sql,#!html,#!markdown,#!mermaid,#!value - A directive appearing mid-cell splits into a new cell of that type below; the original cell keeps its outputs and Id, split-off cells start with empty outputs
- Multiple consecutive directives produce multiple cells in source order; back-to-back directives without a body collapse to the last one
- Unknown bare directives (e.g.
#!ruby,#!kql) soft-degrade to a code cell with the raw token as its language so kernel resolution surfaces a clearer "no kernel" error - Operation directives (
#!set,#!share,#!connect,#!time,#!who,#!whos,#!about,#!lsmagic,#!extension,#!import,#!nuget,#!restart,#!meta,#!r,#!i) and any directive with arguments are left in source for the runtime magic dispatcher DibSerializer.DirectiveMapgains the samecs/fs/python/py/typescript/tsaliases for symmetry between.diband.ipynbimports- Built-in extension count bumped from 37 to 38 to account for the new post-processor
New: Third-Party Extension Directory
notebook/openaccepts anExtensionsDirectoryparameter; when present, the host loads extension assemblies from that directory after built-in discovery- VS Code adds a
verso.extensionsPathconfiguration setting and forwards it to the host when opening a notebook; changes apply on the next open or kernel restart - A missing or empty directory is logged to the Verso output channel but is non-fatal
Improved: Markdown Variable Substitution
MarkdownRenderernow runsVariableSubstitution.Apply(...)on cell source before invoking Markdig, so markdown can include@variabletokens that resolve to current variable values- Substitution runs before Markdown parsing so substituted values are rendered as markdown rather than as escaped text
- Unresolved tokens are preserved verbatim;
@@is an escape sequence that produces a literal@ - New
MarkdownRendererTestscover substitution, ordering relative to parsing, unresolved-token preservation, and the@@escape
Improved: VS Code Logging
- New
vscode/src/log.tswraps aLogOutputChanneland exposestrace/debug/info/warn/error/appendLinehelpers - Activation logs the extension version and the resolved
Verso.Host.dllpath BlazorBridgeandHostProcessroute host spawn, spawn errors, exit warnings, stderr output, and JSON parse failures through the structured logger so all diagnostics land in one "Verso" output channel- Stderr is split into individual lines before logging so each entry is independently filterable; minor
trim()calls switched totrimEnd()to preserve leading whitespace in formatted output
Fixed: Duplicate Assembly References in C# Kernel
CSharpKerneltracks added assembly paths in a new_addedAssemblyPathsset so a path arriving twice (e.g. once from a#!nugetmagic command and again from a later#r "nuget:"directive in the same cell) is added to the Roslyn references at most once- Magic-command assembly paths are consumed from the variable store on the same execution that processes them, so a subsequent cell does not re-process the same paths and misattribute "Installed Packages" feedback to the wrong cell
- The dedup set is cleared on kernel initialization so a restart starts from a clean slate
- Re-publishes the full set of added paths to
NuGetMagicCommand.AssemblyStoreKeyso downstream consumers (e.g.#!sql-connectprovider discovery) can still load them
Removed: ResolvedPackagesStoreKey
- Removed the
ResolvedPackagesStoreKeyconstant (and its duplicate inNuGetReferenceProcessor) along with the code that stored or readList<NuGetResolveResult>from the variable store - Was previously used to render an "Installed Packages" summary but produced misattribution across cells; the new dedup path in
CSharpKernelcovers the underlying need without persisting result objects - Assembly references and extension loading behavior are unchanged