code_forge library

Classes

BiDiSegment
CodeForge
A highly customizable code editor widget for Flutter.
CodeForgeController
Controller for the CodeForge code editor widget.
CodeForgeKeyboardShortcuts
Keyboard shortcuts used by the CodeForge. Ovrride to use your own custom shortcuts.
Defaults to:
CodeSelectionStyle
This class provides styling options for code selection in the code editor.
CompoundOperation
A compound operation that groups multiple edits into one undo unit.
CompoundOperationHandle
Handle for grouping multiple edits into a single undo operation.
CustomCodeSnippet
Represents a single custom code snippet that appears in the editor's suggestion list alongside LSP completions.
CustomContextMenu
Create a custom entry for the context menu (The menu that appears on right click). Pass it to the CodeForge class to add the custom entry to the context menu. eg:
CustomIcons
CustomLanguageGrammar
CustomScrollbar
CustomTheme
CustomViewport
A custom two-dimensional viewport for the code editor.
DeleteOperation
A deletion operation
DiagnosticLine
Use it to display error lints (wavy underlines) in CodeForge.
DocumentColor
Represents a document color to be displayed in the code editor.
DocumentHighlight
Represents a document highlight from LSP. Used to highlight all occurrences of a symbol in the document.
EditOperation
Represents a single edit operation that can be undone/redone. Designed to work efficiently with rope data structures.
FindController
Controller for managing text search functionality in CodeForge.
FoldRange
Represents a foldable code region in the editor.
GhostText
Represents ghost text (inline suggestion) displayed in the editor.
GuideBlock
GutterBuilder
Use the GutterBuilder to render custom content in the gutter. eg:
GutterDecoration
Represents a decoration in the gutter area (line numbers column).
GutterStyle
This class provides styling options for the Gutter.
HighlightedLine
HoverDetailsStyle
Styling options for the hover details popup.
ImeComposition
An in-progress IME composition (e.g. CJK pinyin/kana), rendered as a transient overlay above the document rather than written into it.
InlayHint
Represents an inlay hint to be displayed inline in the code editor.
InsertOperation
An insertion operation
LayoutMap
LineDecoration
Represents a decoration applied to a range of lines in the editor.
LineSummary
LspClientCapabilities
Defines the capabilities of the LSP (Language Server Protocol) client.
LspCompletion
Represents a completion item in the LSP (Language Server Protocol). This class is used internally by the CodeForge widget to display completion suggestions.
LspConfig
LspErrors
Represents an error in the LSP (Language Server Protocol). This class is used internally by the CodeForge widget to display errors in the editor.
LspSemanticToken
LspSignatureHelps
LspSocketConfig
A configuration class for Language Server Protocol (LSP) using WebSocket communication.
LspStdioConfig
This class provides a configuration for Language Server Protocol (LSP) using standard input/output communication. Little bit complex compared to LspSocketConfig.
MatchHighlightStyle
Styles used to highlight occurrences found by the controller.findWord() API.
OverlayStyle
Base class for overlay styling options used in various popup elements.
Render2DCodeField
The render object for the code editor's two-dimensional viewport.
ReplaceOperation
A replacement operation (delete + insert at same position)
Rope
A high-fanout B-tree rope.
RTLAwareScrollPhysics
Custom scroll physics that reverses horizontal drag direction for RTL mode on mobile.
RustFoldRange
ScrollbarDecoration
This class provides both styling and functionality configuration for the scrollbar used in the CodeForge. Only vertical scrollbar can be tweaked using this class.
SearchHighlight
Represents a highlighted search result in the editor
SelectionState
SemanticWordSpan
SuggestionStyle
Styling options for the code completion suggestion popup.
SyntaxHighlighter
UndoRedoController
Controller for managing undo/redo operations.
ViewportFrame
VirtualRemovedBlock
Represents a block of removed lines to be displayed virtually in the editor.
VisibleLineRange

Enums

CompletionItemType
GutterDecorationType
Defines decoration types for gutter decorations.
InlayHintKind
The kind of inlay hint
LineDecorationType
Defines decoration types for line decorations in the editor.

Properties

completionItemIcons ↔ Map<CompletionItemType, Icon>
getter/setter pair

Functions

foldsComputeAll({required Rope rope}) → Future<List<RustFoldRange>>
foldsFindMatchingBracket({required Rope rope, required int targetOffset}) → int
getSemanticMapping(String languageId) → Map<String, List<String>>
Pyright-specific overrides for semantic token mappings. Pyright uses some token types differently than the LSP standard.
guidesComputeViewport({required Rope rope, required BigInt firstVisible, required BigInt lastVisible, required BigInt tabSize}) → List<GuideBlock>
wordsExtract({required Rope rope}) → Future<List<String>>

Typedefs

LspSuggestionBuilder = Widget Function(BuildContext context, LspCompletion suggestion, bool isSelected)
Builds the content of an LSP completion suggestion row.