Skip to content

verso-v1.2.3

Latest

Choose a tag to compare

@github-actions github-actions released this 16 Oct 00:35
· 5 commits to main since this release
6f2e3dd

Release showing each kernel's errors and warnings in the cell editor as you type, letting Console.ReadLine() and input prompts work in C# and F# cells, translating the five showcase layouts and giving extension authors what they need to ship their own translations, theming cell editors from the active VS Code color theme, letting cell editors grow to fit their content, resolving NuGet floating versions and ranges the way dotnet restore does, running notebook post-processors in every host, asking before a save from .ipynb replaces an existing .verso, writing notebook text as itself so a workspace search can find it, passing the cell and output channels through to formatters, and fixing dropped transitive packages, lost C# completions after a re-run, notebook shortcuts firing inside text fields, and widgets that needed IPython after a mid-session install.

Upgrade Notes

  • NuGet versions other than an exact pin may now resolve differently. 1.* stays within major version 1, *-* picks up prereleases, and a range such as [1.0.0,2.0.0) takes the lowest version it allows, as dotnet restore does. Before, every one of these quietly became the latest stable release. A version Verso cannot read, such as latest, is now an error instead of the latest stable release
  • Post-processors now run in every host. verso serve, verso run, verso export and the REPL used to skip them, so a .NET Interactive notebook's #!fsharp and #!sql cells stayed C# cells there. If you wrote a post-processor, it now runs wherever a notebook is opened or saved, and one that throws stops the notebook from opening
  • verso serve --preserve-format now really writes back to the .ipynb. Before, the Save button ignored the option and wrote a .verso file anyway. The .ipynb is written from Verso's model of the notebook, so cell attachments, cell tags and notebook metadata other than the kernel are not carried over
  • Cached NuGet packages with translated resources are downloaded once more. Verso now keeps each language's resource assemblies in its own folder, so a cached package that has them flattened beside its main assemblies is extracted again on first use. That needs a reachable feed once; offline, the reference fails until the machine is back online
  • An HTTP redirect no longer fails the cell. With @no-redirect, a 3xx response is a result, not an error; 4xx and 5xx still fail the cell. The httpStatus variable is an int, which the docs now say
  • verso run --output-file without --output now writes JSON. Before, the format stayed text and the file was never written

New: Diagnostics in the Cell Editor

  • Errors and warnings from the kernel appear as squiggles in the cell editor shortly after you stop typing, when a cell gains focus, and after the cell runs, with the error code and source on hover. Every kernel computed them before, but nothing showed them, so a type error in a C# or F# cell only appeared when the cell ran. Works in VS Code and verso serve. Asked for by @Jonathan-Schaefer-git (#123)
  • Names defined in cells that already ran are known, so using them is not an error, and restarting a kernel clears its markers
  • Requests wait while any cell is running, so checking a cell never delays a run
  • JavaScript and TypeScript cells now report syntax errors. Monaco's own TypeScript checking is turned off in cells, because it could not see earlier cells and flagged display, require and top-level await as errors
  • HTML, Mermaid and SQL cells, and code cells with no language of their own, now get diagnostics, hover and completions from the same kernel that runs them
  • SQL and HTTP cells stay quiet until they have seen the variable store, C# knows notebook parameters once they are injected, and an unfinished #r "nuget: line no longer shifts the markers below it, so a fresh notebook does not light up with false errors

New: Interactive Input in C# and F#

  • Console.ReadLine() and Console.Read() in a C# or F# cell open an input box in VS Code and verso serve. Text the cell wrote just before reading, such as the Name: of Console.Write("Name: "), becomes the prompt, and the answer is echoed into the output the way a terminal shows it. Asked for by @bfcamara (#107)
  • C# cells also get await GetInputAsync("User:") and await GetPasswordAsync("Password:"), the second with a masked input box
  • Dismissing the prompt gives null, the same as end of input in a terminal, and interrupting a cell that is waiting at a prompt stops it
  • verso run and verso repl have no input box, so Console.ReadLine() reads the terminal or a pipe there, as any console program would. Console.ReadKey() is not supported in cells

New: Localized Extensions

  • The five showcase layouts, DAG Notebook, Slide Studio, Grid Studio, Form Studio and Image Studio, follow the interface language in German, Spanish, Japanese and Simplified Chinese. Built-in names such as Form Studio's widget labels and Image Studio's layer names follow the language too, while names you type stay as you typed them
  • Extension authors get IVersoContext.UICulture for the reader's interface language and StringTable.From for handing translated strings to an isolated layout, with each missing string falling back through the parent language to English. A new Localization guide in the extension docs covers both inline and isolated layouts
  • Isolated layouts receive the language as uiCulture on verso/init, and their frame document carries a matching <html lang>. The layout bridge protocol moves to 1.1 for this; a layout built for 1.0 keeps working
  • Translations shipped in an extension's NuGet package now load. Verso used to flatten each language's resource assembly into one folder, where .NET never looks for it

Improved: Cell Editors

  • In VS Code, cell editors take their colors from the active color theme, including its syntax colors and your editor.tokenColorCustomizations, and follow a theme change straight away instead of using stock light and dark palettes. Type and method names stay in the text color, because cells have no semantic highlighting yet. Reported by @redxeagle1 (#108)
  • In verso serve, cell editors take their syntax colors from the Verso theme
  • Cell editors grow to fit their content from 3 lines up to 30, then scroll inside. A longer cell says how many of its lines are showing and how to raise the limit: the verso.editor.maxLines setting in VS Code, or verso serve --max-cell-lines, where 0 removes the limit. The compare view keeps its own 40-line limit. Asked for by @mna-intend (#119)

Improved: NuGet Packages

  • Floating versions and version ranges in #r "nuget:" now resolve the way dotnet restore does, in C# and F#; see the upgrade note above. The README and the Polyglot migration guide show the syntax. Reported by @mna-intend (#124)

Improved: Notebook Files

  • .verso and .ipynb files store source text as itself rather than as \u escapes, so quotes, <, >, + and non-English text in a cell can be found by a workspace search and read in a diff. Older files with escapes still open the same. Reported by @mna-intend (#118)
  • When saving a notebook opened from an .ipynb would replace an existing .verso file of the same name, VS Code and verso serve now ask first and point at the option that keeps the original format. Before, a Jupyter copy made with verso convert could overwrite its own original. Saving to a .verso file directly does not ask, and the command line is unchanged. Reported by @xkqg (#114)
  • Mermaid, HTML and extension cells survive a round trip through .ipynb. They were written as raw cells carrying their Verso type, but read back as plain raw cells (#114)
  • Post-processors run after every open and before every save in every host, and verso convert also runs them before writing its output. Reported by @xkqg (#113)

Improved: Formatters

  • A formatter now receives the cell it is formatting for, as IFormatterContext.CellId, along with the cell's output channels, so it can open a channel and stream into it. The active layout, collapsed sections, interface language, and the output-update and file-download calls now reach formatters run from C# and F# cells too, instead of their defaults. CellId is a new member with a default, so existing formatters keep working. Contributed by @Jonathan-Schaefer-git (#122)

Improved: Command Line and Appearance

  • verso run --verbose reports a cell that produced an error output as Failed rather than as succeeded
  • Light surfaces such as menus and dialogs are white, with a subtle ring and shadow for depth, and sunken surfaces are a shade darker. A theme that does not set these values gets the new defaults
  • A refreshed Verso icon, at a fraction of the old file size

Fixed

  • A package first reached through a long dependency chain no longer loses its own dependencies. The resolver walked depth first with a depth limit of six, so a package met deep in a chain was marked visited there and its dependencies were cut off, which surfaced later as CS0234 or a FileNotFoundException. Both the C# and F# resolvers now walk one level at a time and keep the version declared nearest the notebook. Reported by @mna-intend (#112)
  • C# completions keep working after a cell is edited and run again. Re-running a cell used to leave numbers. offering a handful of items and no members. A later cell's declaration now also takes over from an earlier one of the same name. Reported by @redxeagle1 (#110)
  • Typing a, b, x or dd into a text field, such as a parameters cell's inputs, no longer inserts or deletes cells. Ctrl+Alt+Enter still runs all cells from a field. Reported by @roncli (#106)
  • !pip and %pip lines in Python cells are no longer marked as syntax errors in the editor
  • k3d and other widget libraries now work after #!pip install brings in IPython partway through a session. Verso's stand-in IPython module stayed loaded and the import failed with No module named 'IPython.core'. Restarting the kernel was the only way around it