CDS.CSharpScript2.ScintillaEditor
4.1.0
dotnet add package CDS.CSharpScript2.ScintillaEditor --version 4.1.0
NuGet\Install-Package CDS.CSharpScript2.ScintillaEditor -Version 4.1.0
<PackageReference Include="CDS.CSharpScript2.ScintillaEditor" Version="4.1.0" />
<PackageVersion Include="CDS.CSharpScript2.ScintillaEditor" Version="4.1.0" />
<PackageReference Include="CDS.CSharpScript2.ScintillaEditor" />
paket add CDS.CSharpScript2.ScintillaEditor --version 4.1.0
#r "nuget: CDS.CSharpScript2.ScintillaEditor, 4.1.0"
#:package CDS.CSharpScript2.ScintillaEditor@4.1.0
#addin nuget:?package=CDS.CSharpScript2.ScintillaEditor&version=4.1.0
#tool nuget:?package=CDS.CSharpScript2.ScintillaEditor&version=4.1.0
CDS.CSharpScript2.ScintillaEditor
Scintilla5-based WinForms editor control for C# script editing, powered by Roslyn.
Description
CDS.CSharpScript2.ScintillaEditor provides a drop-in WinForms UserControl that gives your
application a professional C# script editor backed by the Scintilla5 native editing component
and full Roslyn IntelliSense.
Features
- Syntax highlighting — real Roslyn token classification (keywords, types, literals, comments, …).
- Code completion — member lists, type suggestions, and smart single-letter prioritisation.
- Signature help (call tips) — parameter info as you type method calls.
- Hover tooltips — type and XML-doc info on mouse hover.
- Error indicators — squiggles and a live diagnostic list tied to the Roslyn compiler.
- Code folding — fold and unfold regions; save and restore the folded state.
- Find/Replace — built-in find and replace dialog.
- Documentation panel — companion
DocsPanelshowing full XML docs for the symbol at the caret (F1). - Output panel — companion
RTFOutputPanelfor displaying script results. - Ready-made panel —
ScriptEditorPanelcombines the editor, output panel and docs panel in one control.
Quick Start
Add ScintillaScriptEditor to a form and wire up a ScriptEnvironment:
using CDS.CSharpScript2;
using CDS.CSharpScript2.ScintillaEditor;
var editor = new ScintillaScriptEditor();
editor.Dock = DockStyle.Fill;
Controls.Add(editor);
// Setting Environment starts live analysis immediately
editor.API.Environment = ScriptEnvironment.Default;
Compile and run the script the user has typed:
var executable = await editor.API.CompileAsync();
if (!executable.HasErrors)
await executable.RunAsync();
All scripting properties and methods are accessed through editor.API to keep them
separate from the standard WinForms Control surface.
API Surface (editor.API)
| Member | Description |
|---|---|
Environment |
Get/set the ScriptEnvironment (references, namespaces, globals type). Setting it restarts live analysis. |
Script |
Get/set the script text shown in the editor. |
HasErrors |
true when the most recent live-analysis pass found at least one error. |
CurrentDiagnostics |
Diagnostics from the most recent analysis pass. |
CompileAsync() / CompileAsync(cancellationToken) |
Full Roslyn compilation; returns an ExecutableScript. |
CurrentCompiledScript |
The result of the last CompileAsync() call, or null if the script has changed since. |
HighlightText(start, length) |
Highlights a range in the editor. |
ClearHighlightText() |
Removes the active highlight. |
ExpandAllFolds() / CollapseAllFolds() |
Expands or collapses every foldable region. |
CollapsedFoldLines |
Get/set the 0-based line numbers of the collapsed folds, for saving and restoring fold state. |
Manager |
The underlying EditorManager, for hosts that need the analysis results directly (for example the syntax tree). |
ScriptChanged |
Event raised when the user modifies the script text. |
DiagnosticsUpdated |
Event raised when the live-analysis diagnostic set changes. |
Documentation panel (F1)
DocsPanel is a plain UserControl that shows the full XML documentation for the symbol at the
caret: signature, summary, parameters, returns, exceptions, remarks, overloads, and a type's members,
with links between related symbols. Press F1 in the editor to bring it up; it then follows the caret,
until you click a link (it then stays on the pages you choose, with Back and Forward) and F1 returns it
to following the caret. Colours follow the editor's Theme.
The panel never shows or hides itself, so you decide where it lives (a fixed column, a docking pane, a tab, a floating form). Connect it to the editor and react to its two events:
var docsPanel = new DocsPanel { Visible = false, Width = 340, Dock = DockStyle.Right };
Controls.Add(docsPanel);
docsPanel.Editor = editor;
docsPanel.ShowRequested += (_, _) => docsPanel.Visible = true; // F1 in the editor
docsPanel.CloseRequested += (_, _) => docsPanel.Visible = false; // close button or Escape
If you hide the panel by some other means (a docking pane's own close button), call
docsPanel.Close() so that F1 starts fresh. While nothing is subscribed to the editor's
ScriptHelpRequested event (which the panel does when Editor is set), F1 opens the older
provisional API information window instead.
See the CDS.CSharpScript2.WinForms.Sample project for a full working example.
Requirements
- .NET 10.0 (Windows) or .NET Framework 4.8
- x64 or ARM64 — Scintilla5 is a native library; AnyCPU is not supported at runtime
Dependencies
- CDS.CSharpScript2 — core scripting engine
- Scintilla5.NET — managed wrapper for Scintilla5
Attributions
Icon by Flaticon Uicons
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 is compatible. |
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- CDS.CSharpScript2 (>= 4.1.0)
- Scintilla5.NET (>= 7.1.0)
-
net10.0-windows7.0
- CDS.CSharpScript2 (>= 4.1.0)
- Scintilla5.NET (>= 7.1.0)
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 |
|---|---|---|
| 4.1.0 | 96 | 10/21/2026 |
| 4.0.0 | 274 | 9/8/2026 |
| 3.4.0 | 139 | 9/8/2026 |
| 3.3.0 | 161 | 8/25/2026 |
| 3.2.4 | 128 | 8/25/2026 |
| 3.2.3 | 118 | 8/21/2026 |
| 3.2.2 | 119 | 8/20/2026 |
| 3.2.0 | 119 | 8/19/2026 |
| 3.1.0 | 131 | 8/17/2026 |
| 3.0.0 | 123 | 8/15/2026 |
| 2.8.1 | 125 | 8/13/2026 |
| 2.8.0 | 127 | 8/10/2026 |
| 2.7.0 | 124 | 8/13/2026 |
| 2.6.1 | 133 | 8/7/2026 |
| 2.6.0 | 117 | 8/7/2026 |
| 2.5.10 | 123 | 8/4/2026 |
| 2.5.9 | 128 | 8/4/2026 |
| 2.5.8 | 131 | 8/4/2026 |
| 2.5.7 | 132 | 7/29/2026 |
| 2.4.5 | 115 | 7/27/2026 |