verso-v1.0.16
·
7 commits
to main
since this release
Release adding a Display API for inline rich outputs, source file imports, F# variable injection and formatter improvements, and several cross-kernel stability fixes.
New: Display API
- User code can now call
.Display(value)or.Display(value, mimeType)during cell execution to emit inline, MIME-typed outputs - Integrated across all language kernels: C#, F#, Python, JavaScript (Jint and Node), and PowerShell
DisplayHandlerandDisplayFormatterContextresolve formatters and write outputs through the execution pipeline- Convenience
CellOutputfactory methods added:Plain,Html,Svg,Png,Jpeg,Gif,WebP,Bmp,Json,Csv,Mermaid,Error
New: Source File Imports
#!importnow supports importing source files (.cs,.py,.ts, etc.) by mapping file extensions to registered kernels- Magic command lines are extracted and sorted by priority (package directives first, then imports, then other directives) before execution
- Kernel lookup by file extension via
FindKernelByFileExtensionandGetSupportedExtensions
New: Extension Template Scaffolds
- Optional scaffolds for magic commands, cell types, and themes in the extension template
- Template parameters (
includeMagicCommand,includeCellType,includeTheme) control which scaffolds are generated - Sample implementations and corresponding unit tests included
Improved: F# Variable Injection
- Primitive types (string, int, long, double, float, bool, decimal) are now injected as F#-typed
letbindings viaEvalSilent, so type-dependent features likeprintfformat specifiers work correctly - Names that already exist as native FSI bindings are skipped to avoid shadowing
- Non-primitive types fall back to
AddBoundValue
Improved: F# Data Formatter
- Collection display limit is now configurable via
MaxCollectionLimit(default 100) and wired to kernel settings for runtime changes TryFormatAsyncis now an instance method so kernel settings are applied during formattingVariableBridge.UpdateOptionspushes option changes (e.g.,publishPrivateBindings) to the bridge without requiring a kernel restart
Improved: C# Variable Preamble
BuildVariableStorePreamblenow only injects variables that are not already present in the Roslyn script state, preventing type conflicts (e.g., CS0266) when users re-declare a variable with a specific type
Improved: Display Handler MIME Hints
- When a MIME hint is supplied and the value is already a string, the raw string is written directly with the provided MIME type, bypassing the formatter pipeline
Fixed: F# Script Directive Paths on Windows
- Removed forward-slash normalization that broke
#Iinclude-path resolution on Windows - Emit
#r,#load, and#Idirectives using F# verbatim strings (@"...") so backslashes in Windows paths are treated as literal path separators instead of escape sequences
Improved: VS Code Editor Provider
- Host lookup in save/rename/backup flows now uses
hostRegistry.getByUriinstead of the previousgetHostForDocumentscanning logic BlazorBridge.getDocumentUri()exposes the editor's document URI