Interface SyntaxSupport

interface for custom syntax highlight, comments toggling, smart indents, and other language dependent features for source code editors

interface SyntaxSupport;

Properties

NameTypeDescription
content[get] EditableContentreturns editable content
content[set] SyntaxSupportset editable content
supportsToggleBlockComment[get] boolreturn true if toggle block comment is supported for file type
supportsToggleLineComment[get] boolreturn true if toggle line comment is supported for file type

Methods

NameDescription
applySmartIndent (op, source) apply smart indent after edit operation, if needed
canToggleBlockComment (range) return true if can toggle block comments for specified text range
canToggleLineComment (range) return true if can toggle line comments for specified text range
findPairedBracket (p) returns paired bracket {} () [] for char at position p, returns paired char position or p if not found or not bracket
supportsSmartIndents () returns true if smart indent is supported
toggleBlockComment (range, source) toggle block comments for specified text range
toggleLineComment (range, source) toggle line comments for specified text range
updateHighlight (lines, props, changeStartLine, changeEndLine) categorize characters in content by token types