Repository navigation
CodeEdit
Home | API by Category | Complete API Index | API Status
| Field | Value |
|---|---|
| Full name | Electron2D.CodeEdit |
| Namespace | Electron2D |
| Kind | class |
| Category | API Scene |
Edits source text with indentation, delimiters, folding, markers and typed completion.
public class Electron2D.CodeEditLogical lines and Unicode scalar columns share the TextEdit document/history. Fonts and option icons are borrowed; parsing, authoring and first shaping are cold. Required gutters and hover timer belong to this control. Completion providers are application callbacks rather than a built-in language parser. Inherited virtual completion filters participate; hidden non-virtual methods keep the ordinary context filter. Override detection uses a bound typed delegate.
Inherits: TextEdit
Kind: constructor
public CodeEdit()Creates an LTR empty code document with three required gutters and an owned hover timer.
Kind: event
public event System.Action<System.Int32> BreakpointToggledOccurs when a breakpoint is set, cleared or shifted to another line.
Kind: event
public event System.Action CodeCompletionRequestedRequests that the application submit completion candidates.
Kind: event
public event System.Action<System.String, System.Int32, System.Int32> SymbolHoveredReports a symbol after the configured hover delay.
Kind: event
public event System.Action<System.String, System.Int32, System.Int32> SymbolLookupRequests application lookup of a symbol at a logical line/scalar column.
Kind: event
public event System.Action<System.String> SymbolValidateRequests validation of the symbol under the pointer.
Kind: method
public System.Void AddAutoBraceCompletionPair(System.String startKey, System.String endKey)Adds a unique symbol-key brace pair.
-
startKey: Nonempty symbols. -
endKey: Nonempty symbols.
AddCodeCompletionOption(Electron2D.CodeEdit.CodeCompletionKind, System.String, System.String, System.Nullable<Electron2D.Color>, Electron2D.Texture, System.Int32)
Kind: method
public System.Void AddCodeCompletionOption(Electron2D.CodeEdit.CodeCompletionKind type, System.String displayText, System.String insertText, System.Nullable<Electron2D.Color> textColor = null, Electron2D.Texture icon = null, System.Int32 location = 1024)Submits a typed completion candidate without a default value.
-
type: Candidate kind. -
displayText: Menu text. -
insertText: Inserted text. -
textColor: Finite color or white. -
icon: Borrowed texture. -
location: Relative scope location.
AddCodeCompletionOption(Electron2D.CodeEdit.CodeCompletionKind, System.String, System.String, System.Nullable<Electron2D.Color>, Electron2D.Texture, T, System.Int32)
Kind: method
public System.Void AddCodeCompletionOption<T>(Electron2D.CodeEdit.CodeCompletionKind type, System.String displayText, System.String insertText, System.Nullable<Electron2D.Color> textColor = null, Electron2D.Texture icon = null, T value = null, System.Int32 location = 1024)Submits a completion candidate with a borrowed exact generic default value.
-
type: Candidate kind. -
displayText: Menu text. -
insertText: Inserted text. -
textColor: Finite color or white. -
icon: Borrowed texture. -
value: Borrowed typed payload. -
location: Relative scope location.
Kind: method
public System.Void AddCommentDelimiter(System.String startKey, System.String endKey, System.Boolean lineOnly = false)Adds a symbol-delimited comment region.
-
startKey: Unique nonempty symbol key. -
endKey: Symbol key or empty. -
lineOnly: Prevents continuation across LF.
Kind: method
public System.Void AddStringDelimiter(System.String startKey, System.String endKey, System.Boolean lineOnly = false)Adds a symbol-delimited string region, ordered longest start key first.
-
startKey: Unique nonempty symbol key. -
endKey: Symbol key or empty for line-only. -
lineOnly: Prevents continuation across LF.
Kind: method
public System.Boolean CanFoldLine(System.Int32 line)Reports whether enabled folding can hide a region, multiline delimiter or indented block.
Whether children can fold.
-
line: Existing line.
Kind: method
public System.Void CancelCodeCompletion()Cancels the menu and clears visible candidates.
Kind: method
public System.Void ClearBookmarkedLines()Clears bookmarks.
Kind: method
public System.Void ClearBreakpointedLines()Clears all breakpoints, notifying each changed line.
Kind: method
public System.Void ClearCommentDelimiters()Clears comment delimiters while retaining strings.
Kind: method
public System.Void ClearExecutingLines()Clears executing-line markers.
Kind: method
public System.Void ClearStringDelimiters()Clears string delimiters while retaining comments.
Kind: method
public System.Void ConfirmCodeCompletion(System.Boolean replace = false)Confirms the selected candidate through the virtual insertion hook.
-
replace: Replaces the following identifier instead of merging matching suffix text.
Kind: method
public System.Void ConvertIndent(System.Int32 fromLine = -1, System.Int32 toLine = -1)Converts leading indentation of a logical-line interval to the configured tab/space policy.
-
fromLine: Existing start or -1 for document start. -
toLine: Existing inclusive end or -1 for document end.
Kind: method
public System.Void CreateCodeRegion()Wraps selected lines in named comment region tags, folds them and selects the new region name.
Kind: method
protected override System.Func<Electron2D.Node> CreateSceneInstanceFactory()Kind: method
public System.Void DeleteLines()Deletes each selected/caret logical line once.
Kind: method
protected override System.Void Dispose(System.Boolean disposing)Kind: method
public System.Void DoIndent()Indents selections, or inserts indentation at each caret.
Kind: method
public System.Void DuplicateLines()Duplicates complete selected/caret lines and advances their caret identities.
Kind: method
public System.Void DuplicateSelection()Duplicates selected text, or complete lines for unselected carets.
Kind: method
public System.Void FoldAllLines()Folds every supported block.
Kind: method
public System.Void FoldLine(System.Int32 line)Folds a supported block and moves carets from hidden descendants onto its header.
-
line: Existing line.
Kind: method
public System.String GetAutoBraceCompletionCloseKey(System.String openKey)Returns a matching closing key or an empty string.
Closing key.
-
openKey: Exact key.
Kind: method
public System.Int32[] GetBookmarkedLines()Returns an ascending bookmark array.
Logical indices.
Kind: method
public System.Int32[] GetBreakpointedLines()Returns an independent ascending breakpoint line array.
Logical indices.
Kind: method
public Electron2D.CodeCompletionOption GetCodeCompletionOption(System.Int32 index)Gets a stable borrowed immutable visible candidate.
Candidate.
-
index: Existing visible index.
Kind: method
public Electron2D.CodeCompletionOption[] GetCodeCompletionOptions()Gets an independent array of immutable visible candidates.
Borrowed candidate elements.
Kind: method
public System.Int32 GetCodeCompletionSelectedIndex()Gets the selected visible candidate index.
Index, or -1 when inactive.
Kind: method
public System.String GetCodeRegionEndTag()Returns the source region end tag.
Endregion initially.
Kind: method
public System.String GetCodeRegionStartTag()Returns the source region start tag.
Region initially.
Kind: method
public System.String GetDelimiterEndKey(System.Int32 delimiterIndex)Returns the combined ordered delimiter end key.
Source key.
-
delimiterIndex: Existing combined index.
Kind: method
public Electron2D.Vector2 GetDelimiterEndPosition(System.Int32 line, System.Int32 column)Returns the delimiter end boundary after its closing key, or line-length plus one for line-only.
Column/line, or (-1,-1) if unavailable/unclosed.
-
line: Existing line. -
column: Scalar position.
Kind: method
public System.String GetDelimiterStartKey(System.Int32 delimiterIndex)Returns the combined ordered delimiter start key.
Source key.
-
delimiterIndex: Existing combined index.
Kind: method
public Electron2D.Vector2 GetDelimiterStartPosition(System.Int32 line, System.Int32 column)Returns the delimiter start boundary one scalar after its opening key begins.
Column/line, or (-1,-1).
-
line: Existing line. -
column: Scalar position.
Kind: method
public System.Int32[] GetExecutingLines()Returns an ascending executing-line array.
Logical indices.
Kind: method
public System.Int32[] GetFoldedLines()Returns an independent ascending folded-header array.
Logical indices.
Kind: method
protected override System.Collections.Generic.IEnumerable<Electron2D.PropertyDescriptor> GetPropertyDescriptors()Kind: method
public System.String GetTextForCodeCompletion()Returns cursor-marked text at the primary caret.
Source with U+FFFF.
Kind: method
public System.String GetTextForSymbolLookup()Returns cursor-marked text at the current symbol-lookup position.
Source with U+FFFF.
Kind: method
public System.String GetTextWithCursorChar(System.Int32 line, System.Int32 column)Returns the complete text with U+FFFF at a logical/scalar coordinate.
Cursor-marked text.
-
line: Existing line. -
column: Scalar column.
Kind: method
public System.Boolean HasAutoBraceCompletionCloseKey(System.String closeKey)Reports a closing brace key.
Whether present.
-
closeKey: Exact key.
Kind: method
public System.Boolean HasAutoBraceCompletionOpenKey(System.String openKey)Reports an opening brace key.
Whether present.
-
openKey: Exact key.
Kind: method
public System.Boolean HasCommentDelimiter(System.String startKey)Reports an exact comment start key.
Whether present.
-
startKey: Exact key.
Kind: method
public System.Boolean HasStringDelimiter(System.String startKey)Reports an exact string start key.
Whether present.
-
startKey: Exact key.
Kind: method
public System.Void IndentLines()Indents each selected/caret line once, omitting empty lines.
Kind: method
public System.Int32 IsInComment(System.Int32 line, System.Int32 column = -1)Returns a combined comment delimiter index at a scalar position, or for a wholly covered line.
Combined index or -1.
-
line: Existing line. -
column: Scalar position, or -1 for whole line.
Kind: method
public System.Int32 IsInString(System.Int32 line, System.Int32 column = -1)Returns a combined string delimiter index at a scalar position, or for a wholly covered line.
Combined index or -1.
-
line: Existing line. -
column: Scalar position, or -1 for whole line.
Kind: method
public System.Boolean IsLineBookmarked(System.Int32 line)Reports a bookmark.
Marker state.
-
line: Existing line.
Kind: method
public System.Boolean IsLineBreakpointed(System.Int32 line)Reports a breakpoint marker.
Marker state.
-
line: Existing line.
Kind: method
public System.Boolean IsLineCodeRegionEnd(System.Int32 line)Reports a single-line-comment code-region end.
Whether the configured tag begins this line.
-
line: Existing line.
Kind: method
public System.Boolean IsLineCodeRegionStart(System.Int32 line)Reports a single-line-comment code-region start.
Whether the configured tag begins this line.
-
line: Existing line.
Kind: method
public System.Boolean IsLineExecuting(System.Int32 line)Reports an executing-line marker.
Marker state.
-
line: Existing line.
Kind: method
public System.Boolean IsLineFolded(System.Int32 line)Reports an explicit folded header.
Fold state.
-
line: Existing line.
Kind: method
public System.Void JoinLines(System.String lineEnding = " ")Joins selected/caret lines with following lines, trimming connecting whitespace.
-
lineEnding: Nonnull inserted separator.
Kind: method
public System.Void MoveLinesDown()Moves selected/caret line ranges downward with their gutters and backgrounds.
Kind: method
public System.Void MoveLinesUp()Moves selected/caret line ranges upward with their gutters and backgrounds.
Kind: method
protected override System.Void OnBackspace(System.Int32 caretIndex)Kind: method
protected virtual System.Void OnConfirmCodeCompletion(System.Boolean replace)Inserts the active candidate as one undo group and cancels completion.
-
replace: Replaces the following identifier.
Kind: method
protected override System.Void OnCut(System.Int32 caretIndex)Kind: method
protected virtual Electron2D.CodeCompletionOption[] OnFilterCodeCompletionCandidates(Electron2D.CodeCompletionOption[] candidates)Filters application candidates into their visible order. An override owns the complete filter and insertion prefix is empty.
Non-null candidate array without null elements.
-
candidates: Independent array of borrowed immutable candidates.
Kind: method
protected override System.Void OnGUIInput(Electron2D.InputEvent inputEvent)Kind: method
protected override Electron2D.CursorShape OnGetCursorShape(Electron2D.Vector2 atPosition)Kind: method
protected override System.Void OnHandleUnicodeInput(System.Int32 unicodeChar, System.Int32 caretIndex)Kind: method
protected override System.Void OnNotification(System.Int32 what)Kind: method
protected override System.Void OnPaste(System.Int32 caretIndex)Kind: method
protected virtual System.Void OnRequestCodeCompletion(System.Boolean force)Requests candidate production after validating ordinary query context.
-
force: Bypasses word/prefix checks.
Kind: method
protected override System.Void OnTextInput(System.String text)Kind: method
public System.Void RemoveCommentDelimiter(System.String startKey)Removes a comment delimiter by start key.
-
startKey: Exact key.
Kind: method
public System.Void RemoveStringDelimiter(System.String startKey)Removes a string delimiter by start key.
-
startKey: Exact key.
Kind: method
public System.Void RequestCodeCompletion(System.Boolean force = false)Requests application completion using the typed virtual request hook.
-
force: Bypasses ordinary prefix/context checks.
Kind: method
public System.Void SetCodeCompletionSelectedIndex(System.Int32 index)Changes selection while completion is active.
-
index: Existing visible candidate index.
Kind: method
public System.Void SetCodeHint(System.String codeHint)Sets source code-hint text; empty clears it. U+FFFF toggles highlighted argument spans.
-
codeHint: Nonnull text.
Kind: method
public System.Void SetCodeHintDrawBelow(System.Boolean drawBelow)Chooses whether the code hint is below or above the primary caret.
-
drawBelow: True draws below.
Kind: method
public System.Void SetCodeRegionTags(System.String start = "region", System.String end = "endregion")Sets source region tags without a comment prefix.
-
start: Nonempty start tag. -
end: Nonempty end tag.
Kind: method
public System.Void SetLineAsBookmarked(System.Int32 line, System.Boolean bookmarked)Sets a runtime bookmark.
-
line: Existing line. -
bookmarked: Desired state.
Kind: method
public System.Void SetLineAsBreakpoint(System.Int32 line, System.Boolean breakpointed)Sets a runtime breakpoint marker.
-
line: Existing line. -
breakpointed: Desired state.
Kind: method
public System.Void SetLineAsExecuting(System.Int32 line, System.Boolean executing)Sets an executing-line marker.
-
line: Existing line. -
executing: Desired state.
Kind: method
public System.Void SetSymbolLookupWordAsValid(System.Boolean valid)Marks the most recently requested pointer symbol as eligible for lookup.
-
valid: Validation result.
Kind: method
public System.Void ToggleFoldableLine(System.Int32 line)Toggles a supported folded header.
-
line: Existing line.
Kind: method
public System.Void ToggleFoldableLinesAtCarets()Toggles each distinct caret header.
Kind: method
public System.Void UnfoldAllLines()Clears all folds and restores every logical line.
Kind: method
public System.Void UnfoldLine(System.Int32 line)Unfolds the containing folded header while preserving nested folded blocks.
-
line: Existing header or hidden line.
Kind: method
public System.Void UnindentLines()Removes one indentation stop from each selected/caret line.
Kind: method
public System.Void UpdateCodeCompletionOptions(System.Boolean force)Replaces the current candidate sources with the submitted queue and filters them.
-
force: Allows presentation with an empty prefix.
Kind: property
public System.Boolean AutoBraceCompletionEnabled { get; set; }Gets or sets automatic paired insertion, closing-key skip and paired backspace.
False initially.
Kind: property
public System.Boolean AutoBraceCompletionHighlightMatching { get; set; }Gets or sets matching and mismatched brace underlines.
False initially.
Kind: property
public System.Collections.Generic.IReadOnlyDictionary<System.String, System.String> AutoBraceCompletionPairs { get; set; }Gets or sets independent brace-key mappings.
Parentheses, brackets, braces and quotes initially.
Kind: property
public System.Boolean CodeCompletionEnabled { get; set; }Gets or sets automatic completion requests after committed text.
False initially.
Kind: property
public System.String[] CodeCompletionPrefixes { get; set; }Gets or sets copied single-scalar completion prefixes.
Empty initially.
Kind: property
public System.String[] DelimiterComments { get; set; }Gets or sets copied comment delimiter descriptions.
Empty initially.
Kind: property
public System.String[] DelimiterStrings { get; set; }Gets or sets copied string delimiter descriptions encoded as start and optional end keys.
Single and double quotes initially.
Kind: property
public System.Boolean GuttersDrawBookmarks { get; set; }Gets or sets bookmark icons in the main gutter.
False initially.
Kind: property
public System.Boolean GuttersDrawBreakpointsGutter { get; set; }Gets or sets breakpoint icons and pointer toggling in the main gutter.
False initially.
Kind: property
public System.Boolean GuttersDrawExecutingLines { get; set; }Gets or sets execution markers in the main gutter.
False initially.
Kind: property
public System.Boolean GuttersDrawFoldGutter { get; set; }Gets or sets folding icons and pointer toggling.
False initially.
Kind: property
public System.Boolean GuttersDrawLineNumbers { get; set; }Gets or sets logical line-number presentation.
False initially.
Kind: property
public System.Int32 GuttersLineNumbersMinDigits { get; set; }Gets or sets the minimum number of line-number digits.
Three initially.
Kind: property
public System.Boolean GuttersZeroPadLineNumbers { get; set; }Gets or sets zero padding instead of space padding in line numbers.
False initially.
Kind: property
public System.Boolean IndentAutomatic { get; set; }Gets or sets indentation inheritance and configured prefix expansion on newlines.
False initially.
Kind: property
public System.String[] IndentAutomaticPrefixes { get; set; }Gets or sets copied single-scalar automatic indentation prefixes.
Colon and opening braces initially.
Kind: property
public System.Int32 IndentSize { get; set; }Gets or sets the positive indentation/tab width.
Four initially.
Kind: property
public System.Boolean IndentUseSpaces { get; set; }Gets or sets space indentation instead of tab indentation.
False initially.
Kind: property
public System.Boolean LineFolding { get; set; }Gets or sets code-region, delimiter-block and indentation folding.
False initially.
Kind: property
public System.Int32[] LineLengthGuidelines { get; set; }Gets or sets copied nonnegative scalar guideline columns.
Empty initially.
Kind: property
public System.Boolean SymbolLookupOnClick { get; set; }Gets or sets validated symbol lookup on command-modified pointer clicks.
False initially.
Kind: property
public System.Boolean SymbolTooltipOnHover { get; set; }Gets or sets symbol hover requests after the project tooltip delay.
False initially.