FryPdf.Plugin.CSharpEditor 2.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package FryPdf.Plugin.CSharpEditor --version 2.0.1
                    
NuGet\Install-Package FryPdf.Plugin.CSharpEditor -Version 2.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FryPdf.Plugin.CSharpEditor" Version="2.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FryPdf.Plugin.CSharpEditor" Version="2.0.1" />
                    
Directory.Packages.props
<PackageReference Include="FryPdf.Plugin.CSharpEditor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FryPdf.Plugin.CSharpEditor --version 2.0.1
                    
#r "nuget: FryPdf.Plugin.CSharpEditor, 2.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FryPdf.Plugin.CSharpEditor@2.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FryPdf.Plugin.CSharpEditor&version=2.0.1
                    
Install as a Cake Addin
#tool nuget:?package=FryPdf.Plugin.CSharpEditor&version=2.0.1
                    
Install as a Cake Tool

CSharpPlayground (FrySharp)

CI License: MIT .NET Avalonia UI

CSharpPlayground (standalone executable: FrySharp) is an interactive multi-language code studio, polyglot Jupyter-style notebook environment, and script automation engine for .NET 10, Python, Rust, and extensible language toolchains built with Avalonia UI.

It operates both as:

  1. A Standalone Desktop Application (FrySharp): Native desktop app for macOS (.dmg) and Windows (.msix / .exe installer) with an authentic VS Code-inspired 5-zone IDE layout.
  2. A FryPDF Ecosystem Plugin (com.frypdf.plugin.csharpeditor): Edge-to-edge full-viewport workspace studio and document automation plugin for FryPDF.

🎬 Product Demo

FrySharp Demo: Run C#, Python, Rust, Go, Java, C++, JS, F# & SQL in ONE Unified Notebook & IDE

▢️ Click here to watch the FrySharp Demo on YouTube β€” Supports C#, Python, Rust, Go, Java, C++, JavaScript, F# & SQL


🌟 Key Features

  • Authentic VS Code Layout & Ergonomics:
    • Activity Bar: Explorer, Search, Run & Debug, Package & Dependency Manager (NuGet, pip, npm), Scratchpad, and Problems badges.
    • Primary Side Bar: Multi-language file tree, project explorer, and script management hub.
    • Multi-Tab Editor: Smooth horizontal tab bar with dirty indicators (●), quick close, and isolated execution states.
    • Bottom Tool Deck: Problems (Roslyn diagnostics and external language tracebacks with quick-fixes), Output, Terminal Console (with interactive stdin), Debug REPL, and Rich Results.
    • Status Bar: Execution timer (⏱ 14ms), line/column coordinates, spaces, UTF-8, active language & toolchain status (C# (.NET 10 Roslyn), Python 3.12 (.venv), etc.), and compiler status.
  • Interactive Jupyter-Style C# Notebooks:
    • Stateful cell execution kernel chaining submissions using Roslyn Scripting API.
    • NuGet package resolution directly in scripts (#r "nuget: ...").
    • Rich output display: text, images, charts, and custom Avalonia controls (Display.Image(...), Display.Control(...)).
    • Cell input/output collapsing, folding, and export.
  • Polyglot Notebooks & Multi-Language Support:
    • Nine Languages: Full multi-language execution and editing for C# (.NET 10 Roslyn), Python (3.9+), JavaScript (Node.js), Java (JDK 17+ / JShell), C++ (C++20 via Clang, GCC, MSVC), Go, F#, SQL (SQLite) and Rust (rustc / Cargo 1.70+).
    • Native C++ & Zero-Config Display Runtime: .cpp files compile with -std=c++20, include <fry/display.hpp> out of the box for interactive table and image dumps, and support native DAP debugging via lldb-dap.
    • Rust with Cargo: .rs files build as a generated Cargo package that points at the file where it is (so mod x; siblings, compiler messages and debug info all name the real file). Crates come from comments such as // #crate: rand = "0.8" (also // #edition: 2024, // #profile: release) and are compiled once into a build folder shared by every script; fry::table(&rows, "Title") and fry::dump!(value) put tables in the Results deck with no setup; rustc's messages land in Problems at the right line and column, with an "Install crate" quick-fix; debugging runs on lldb-dap with Rust's own pretty-printers. Static completion and hover come with the editor; a rust-analyzer client can replace them later through EditorAssistants.
    • Rust notebooks: each cell is built and run; functions, types, imports and macros a cell defines stay for the cells after it, the value of a cell's last expression is shown (a list of structs as a table), ? works, and a variable made with let stays for the cells after it, with its type and any changes made to it (numbers, text, lists, options, tuples, maps and sets are kept; a struct of your own, a closure or a reference isn't, and a later cell that needs one is told why it's gone). fry::share!(x) keeps a value as data for #!share --from rust x in other languages.
    • Polyglot Interactive Notebooks: Mix cells in C#, Python, JS, Java, C++, Go, F#, SQL and Rust in a single notebook document. Cross-language data sharing via #!share --from <lang> <var> converts primitives, vectors, and tables across kernel boundaries as JSON.
    • Intelligent Toolchain Discovery: Automatic detection of project virtual environments, Homebrew, Xcode, MSVC, JDKs, and system PATH with actionable missing-toolchain guidance. See docs/adding-a-language.md and docs/kernel-protocol.md.
  • Tabular Data Analytics:
    • Native display and profiling for DataTable, DataView, and Microsoft.Data.Analysis DataFrame.
    • Column summaries, data types, row counts, and inline search.
  • Real-Time Roslyn Diagnostics:
    • Debounced (350ms) background analysis via Microsoft.CodeAnalysis.CSharp.
    • "Problems" drawer with error/warning counts, line/column coordinates, and click-to-jump navigation.
  • Interactive Debugging:
    • Visual gutter breakpoints, line highlighting, and stepping controls (F5 Continue, F10 Step Over, F11 Step Into, Shift+F5 Stop).
    • Variable inspector and immediate REPL evaluation.

πŸš€ Quick Start

Prerequisites

Run Standalone Desktop App (FrySharp)

# Clone the repository
git clone https://github.com/PrashantUnity/CSharpPlayground.git
cd CSharpPlayground

# Run standalone desktop app
dotnet run --project Runner/CSharpEditorPlugin.Runner.csproj

Run Automated Unit Tests

# Run the unit tests (the real-Python ones run when Python 3.9+ is installed)
dotnet test CSharpEditorPlugin.slnx

πŸ“¦ Solution Structure

CSharpPlayground/
β”œβ”€β”€ CSharpEditorPlugin.slnx         # Modern XML solution (Engine + Runner + Tests)
β”œβ”€β”€ CSharpEditorPlugin.csproj       # Core Studio & Plugin library (.NET 10)
β”œβ”€β”€ CSharpEditorPlugin.cs           # IFryPlugin entrypoint
β”œβ”€β”€ plugin.json                     # FryPDF marketplace manifest
β”œβ”€β”€ Controls/                       # VS Code activity bar, status bar, tabs, editor
β”œβ”€β”€ Models/                         # POCO models for scripts, cells, diagnostics
β”œβ”€β”€ Services/                       # Roslyn compiler, kernel, completion, debugger
β”‚   β”œβ”€β”€ Languages/                  # Language registry and one module per language (Python/Kernel: the kernel program; Rust: Cargo, fry, lldb-dap)
β”‚   β”œβ”€β”€ Toolchains/ Processes/      # Finding installed toolchains; running programs (stdin, Stop, cleanup)
β”‚   └── Kernels/ Packages/          # Notebook kernels per language, #!share, the kernel protocol; pip
β”œβ”€β”€ ViewModels/                     # Reactive MVVM view models
β”œβ”€β”€ Views/                          # Avalonia XAML views (Studio, Notebook, Manager)
β”œβ”€β”€ Runner/                         # Standalone desktop executable (FrySharp)
β”‚   β”œβ”€β”€ CSharpEditorPlugin.Runner.csproj
β”‚   β”œβ”€β”€ Program.cs / App.axaml
β”‚   └── MainWindow.axaml
β”œβ”€β”€ Tests/                          # Comprehensive xUnit test suite (2,100+ tests; Real*/ folders need each real toolchain: Python, Rust, Go, Delve, netcoredbg…)
β”‚   └── CSharpEditorPlugin.Tests.csproj
β”œβ”€β”€ tools/UiSnapshots/              # Headless renderer: real views to PNG, for checking UI changes
β”œβ”€β”€ docs/                           # Developer guides: headless UI snapshots, adding a language, the kernel protocol
└── packaging/                      # macOS DMG & Windows MSIX/Inno packaging assets

πŸ— Architecture: Stateful Notebook Execution

flowchart TD
    subgraph Notebook UI
        C1["Cell 1: var m = 10;"]
        C2["Cell 2: Console.WriteLine(m * 2);"]
        C3["Cell 3: Display.Image(surface.Snapshot());"]
    end

    subgraph "NotebookExecutionKernel (Persistent Session)"
        Init["ScriptOptions\n(System Refs + NuGet Refs + Usings)"]
        S0["Submission #0: ScriptState\n(Creates 'm' field, Output = 10)"]
        S1["Submission #1: ScriptState.ContinueWithAsync\n(References S0, Reads 'm', Output = 20)"]
        S2["Submission #2: ScriptState.ContinueWithAsync\n(References S1, Rich Media Display)"]
        VarExp["Variable Inspector State\n[m : int = 10]"]
    end

    subgraph Rich Cell Output
        Out1["Text Output / Badge"]
        Out2["Console Output: 20"]
        Out3["Avalonia Image Control\n(Zoom, Copy, Save PNG)"]
    end

    C1 -->|"Execute Cell"| S0
    S0 -->|"State Chaining"| S1
    C2 -->|"Execute Cell"| S1
    S1 -->|"State Chaining"| S2
    C3 -->|"Execute Cell"| S2
    
    S0 --> VarExp
    S1 --> VarExp
    S2 --> VarExp

    S0 --> Out1
    S1 --> Out2
    S2 --> Out3

πŸ“œ License

MIT License. See LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.8 88 10/22/2026
2.0.7 95 10/16/2026
2.0.5 94 10/14/2026
2.0.4 99 10/9/2026
2.0.3 99 10/4/2026
2.0.2 105 10/1/2026
2.0.1 103 10/1/2026
2.0.0 99 9/28/2026
1.0.6 105 9/25/2026
1.0.5 107 9/25/2026
1.0.4 107 9/24/2026
1.0.3 107 9/24/2026
0.1.2 111 9/21/2026
0.1.1 111 9/17/2026
0.1.0 109 9/14/2026
0.0.9 109 9/13/2026