Signal3
Signal support.
CodeEdit.swift:3427class Signal3
Use the connect(flags:_:)
method to connect to the signal on the container object, and disconnect(_:)
to drop the connection.
You can also await the emitted
property for waiting for a single emission of the signal.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (96) members.
Types
enum CodeCompletionKind
enum CodeCompletionLocation
class Signal1
Signal support.
class Signal2
Signal support.
Type members
Instance members
var autoBraceCompletionEnabled: Bool
Sets whether brace pairs should be autocompleted.
var autoBraceCompletionHighlightMatching: Bool
Highlight mismatching brace pairs.
var autoBraceCompletionPairs: GDictionary
Sets the brace pairs to be autocompleted.
var breakpointToggled: Signal1
Emitted when a breakpoint is added or removed from a line. If the line is moved via backspace a removed is emitted at the old line.
var codeCompletionEnabled: Bool
Sets whether code completion is allowed.
var codeCompletionPrefixes: VariantCollection<String>
Sets prefixes that will trigger code completion.
var codeCompletionRequested: SimpleSignal
Emitted when the user requests code completion.
var delimiterComments: VariantCollection<String>
Sets the comment delimiters. All existing comment delimiters will be removed.
var delimiterStrings: VariantCollection<String>
Sets the string delimiters. All existing string delimiters will be removed.
var guttersDrawBookmarks: Bool
Sets if bookmarked should be drawn in the gutter. This gutter is shared with breakpoints and executing lines.
var guttersDrawBreakpointsGutter: Bool
Sets if breakpoints should be drawn in the gutter. This gutter is shared with bookmarks and executing lines.
var guttersDrawExecutingLines: Bool
Sets if executing lines should be marked in the gutter. This gutter is shared with breakpoints and bookmarks lines.
var guttersDrawFoldGutter: Bool
Sets if foldable lines icons should be drawn in the gutter.
var guttersDrawLineNumbers: Bool
Sets if line numbers should be drawn in the gutter.
var guttersZeroPadLineNumbers: Bool
Sets if line numbers drawn in the gutter are zero padded.
var indentAutomatic: Bool
Sets whether automatic indent are enabled, this will add an extra indent if a prefix or brace is found.
var indentAutomaticPrefixes: VariantCollection<String>
Prefixes to trigger an automatic indent.
var indentSize: Int32
Size of the tabulation indent (one [kbd]Tab[/kbd] press) in characters. If
indentUseSpaces
is enabled the number of spaces to use.var indentUseSpaces: Bool
Use spaces instead of tabs for indentation.
var lineFolding: Bool
Sets whether line folding is allowed.
var lineLengthGuidelines: VariantCollection<Int64>
Draws vertical lines at the provided columns. The first entry is considered a main hard guideline and is draw more prominently.
var symbolLookup: Signal2
Emitted when the user has clicked on a valid symbol.
var symbolLookupOnClick: Bool
Set when a validated word from [signal symbol_validate] is clicked, the [signal symbol_lookup] should be emitted.
var symbolValidate: Signal3
Emitted when the user hovers over a symbol. The symbol should be validated and responded to, by calling
setSymbolLookupWordAsValid(_:)
.func addAutoBraceCompletionPair(startKey: String, endKey: String
) Adds a brace pair.
func addCodeCompletionOption(type: CodeEdit.CodeCompletionKind, displayText: String, insertText: String, textColor: Color, icon: Resource?, value: Variant, location: Int32
) Submits an item to the queue of potential candidates for the autocomplete menu. Call
updateCodeCompletionOptions(force:)
to update the list.func addCommentDelimiter(startKey: String, endKey: String, lineOnly: Bool
) Adds a comment delimiter.
func addStringDelimiter(startKey: String, endKey: String, lineOnly: Bool
) Adds a string delimiter.
func canFoldLine(Int32
) -> Bool Returns if the given line is foldable, that is, it has indented lines right below it or a comment / string block.
func cancelCodeCompletion(
) Cancels the autocomplete menu.
func clearBookmarkedLines(
) Clears all bookmarked lines.
func clearBreakpointedLines(
) Clears all breakpointed lines.
func clearCommentDelimiters(
) Removes all comment delimiters.
func clearExecutingLines(
) Clears all executed lines.
func clearStringDelimiters(
) Removes all string delimiters.
func confirmCodeCompletion(replace: Bool
) Inserts the selected entry into the text. If
replace
is true, any existing text is replaced rather than merged.func convertIndent(fromLine: Int32, toLine: Int32
) Converts the indents of lines between
fromLine
andtoLine
to tabs or spaces as set byindentUseSpaces
.func createCodeRegion(
) Creates a new code region with the selection. At least one single line comment delimiter have to be defined (see
addCommentDelimiter(startKey:endKey:lineOnly:)
).func doIndent(
) Perform an indent as if the user activated the “ui_text_indent” action.
func duplicateLines(
) Duplicates all lines currently selected with any caret. Duplicates the entire line beneath the current one no matter where the caret is within the line.
func foldAllLines(
) Folds all lines that are possible to be folded (see
canFoldLine(_:)
).func foldLine(Int32
) Folds the given line, if possible (see
canFoldLine(_:)
).func getAutoBraceCompletionCloseKey(openKey: String
) -> String Gets the matching auto brace close key for
openKey
.func getBookmarkedLines(
) -> PackedInt32Array Gets all bookmarked lines.
func getBreakpointedLines(
) -> PackedInt32Array Gets all breakpointed lines.
func getCodeCompletionOption(index: Int32
) -> GDictionary Gets the completion option at
index
. The returnGDictionary
has the following key-values:func getCodeCompletionOptions(
) -> VariantCollection<GDictionary> Gets all completion options, see
getCodeCompletionOption(index:)
for return content.func getCodeCompletionSelectedIndex(
) -> Int32 Gets the index of the current selected completion option.
func getCodeRegionEndTag(
) -> String Returns the code region end tag (without comment delimiter).
func getCodeRegionStartTag(
) -> String Returns the code region start tag (without comment delimiter).
func getDelimiterEndKey(delimiterIndex: Int32
) -> String Gets the end key for a string or comment region index.
func getDelimiterEndPosition(line: Int32, column: Int32
) -> Vector2 If
line
column
is in a string or comment, returns the end position of the region. If not or no end could be found, bothVector2
values will be-1
.func getDelimiterStartKey(delimiterIndex: Int32
) -> String Gets the start key for a string or comment region index.
func getDelimiterStartPosition(line: Int32, column: Int32
) -> Vector2 If
line
column
is in a string or comment, returns the start position of the region. If not or no start could be found, bothVector2
values will be-1
.func getExecutingLines(
) -> PackedInt32Array Gets all executing lines.
func getFoldedLines(
) -> VariantCollection<Int64> Returns all lines that are current folded.
func getTextForCodeCompletion(
) -> String Returns the full text with char
0xFFFF
at the caret location.func getTextForSymbolLookup(
) -> String Returns the full text with char
0xFFFF
at the cursor location.func getTextWithCursorChar(line: Int32, column: Int32
) -> String Returns the full text with char
0xFFFF
at the specified location.func hasAutoBraceCompletionCloseKey(String
) -> Bool Returns
true
if close keycloseKey
exists.func hasAutoBraceCompletionOpenKey(String
) -> Bool Returns
true
if open keyopenKey
exists.func hasCommentDelimiter(startKey: String
) -> Bool Returns
true
if commentstartKey
exists.func hasStringDelimiter(startKey: String
) -> Bool Returns
true
if stringstartKey
exists.func indentLines(
) Indents selected lines, or in the case of no selection the caret line by one.
func isInComment(line: Int32, column: Int32
) -> Int32 Returns delimiter index if
line
column
is in a comment. Ifcolumn
is not provided, will return delimiter index if the entireline
is a comment. Otherwise-1
.func isInString(line: Int32, column: Int32
) -> Int32 Returns the delimiter index if
line
column
is in a string. Ifcolumn
is not provided, will return the delimiter index if the entireline
is a string. Otherwise-1
.func isLineBookmarked(line: Int32
) -> Bool Returns whether the line at the specified index is bookmarked or not.
func isLineBreakpointed(line: Int32
) -> Bool Returns whether the line at the specified index is breakpointed or not.
func isLineCodeRegionEnd(line: Int32
) -> Bool Returns whether the line at the specified index is a code region end.
func isLineCodeRegionStart(line: Int32
) -> Bool Returns whether the line at the specified index is a code region start.
func isLineExecuting(line: Int32
) -> Bool Returns whether the line at the specified index is marked as executing or not.
func isLineFolded(line: Int32
) -> Bool Returns whether the line at the specified index is folded or not.
func removeCommentDelimiter(startKey: String
) Removes the comment delimiter with
startKey
.func removeStringDelimiter(startKey: String
) Removes the string delimiter with
startKey
.func requestCodeCompletion(force: Bool
) Emits [signal code_completion_requested], if
force
is true will bypass all checks. Otherwise will check that the caret is in a word or in front of a prefix. Will ignore the request if all current options are of type file path, node path or signal.func setCodeCompletionSelectedIndex(Int32
) Sets the current selected completion option.
func setCodeHint(String
) Sets the code hint text. Pass an empty string to clear.
func setCodeHintDrawBelow(Bool
) Sets if the code hint should draw below the text.
func setCodeRegionTags(start: String, end: String
) Sets the code region start and end tags (without comment delimiter).
func setLineAsBookmarked(line: Int32, bookmarked: Bool
) Sets the line as bookmarked.
func setLineAsBreakpoint(line: Int32, breakpointed: Bool
) Sets the line as breakpointed.
func setLineAsExecuting(line: Int32, executing: Bool
) Sets the line as executing.
func setSymbolLookupWordAsValid(Bool
) Sets the symbol emitted by [signal symbol_validate] as a valid lookup.
func toggleFoldableLine(Int32
) Toggle the folding of the code block at the given line.
func unfoldAllLines(
) Unfolds all lines, folded or not.
func unfoldLine(Int32
) Unfolds all lines that were previously folded.
func unindentLines(
) Unindents selected lines, or in the case of no selection the caret line by one. Same as performing “ui_text_unindent” action.
func updateCodeCompletionOptions(force: Bool
) Submits all completion options added with
addCodeCompletionOption(type:displayText:insertText:textColor:icon:value:location:)
. Will try to force the autocomplete menu to popup, ifforce
istrue
.
Show implementation details (3)
Hide implementation details
func _confirmCodeCompletion(replace: Bool
) Override this method to define how the selected entry should be inserted. If
replace
is true, any existing text should be replaced.func _filterCodeCompletionCandidates(VariantCollection<GDictionary>
) -> VariantCollection<GDictionary> Override this method to define what items in
candidates
should be displayed.func _requestCodeCompletion(force: Bool
) Override this method to define what happens when the user requests code completion. If
force
is true, any checks should be bypassed.
Citizens in SwiftGodot
Instance members
var emitted: Void
You can await this property to wait for the signal to be emitted once
func connect(flags: Object.ConnectFlags, @escaping (_ symbol: String) -> ()
) -> Object Connects the signal to the specified callback
func disconnect(Object
) Disconnects a signal that was previously connected, the return value from calling
connect(flags:_:)