code library
Optional snippet language service and theme-free decoration types. Markdown recognition and document authority remain in the Flark kernel.
Classes
- CodeEditingDelegate
- Optional synchronous snippet editing. Coordinates refer to the projected code body (UTF-16, LF), without Markdown container prefixes. The caller owns the delegate; Flark owns validation, source translation and history.
- CodeEditProposal
- CodeHighlight
- CodeToken
Enums
- CodeEditingAction
- CodeSyntaxRole
- The presentation roles a highlighter's scope names collapse to. Hosts theme these, not the scope vocabulary: the analyzer emits well over twenty names, and a host that keys its theme on raw scopes silently renders the ones it has not enumerated as ordinary body text.
Constants
- codeAutoLanguage → const String
- The info-string language that asks for detection, as an untagged fence does. Clearing a fence's language writes it where metadata follows, so the metadata keeps its place instead of being read as the language.
Functions
-
codeIndentUnit(
String text, String language) → String - A stable editing step: two spaces, four for Python, or an existing tab. Re-inferring a space width after indenting makes Tab/Shift-Tab asymmetric.
-
codeInfoLanguage(
String info) → String - The first word of a fence's info string, everything before its first whitespace, as written: the word CommonMark reads as the language.
-
codeLeadingWhitespace(
String text) → String -
codeSyntaxRole(
String? kind) → CodeSyntaxRole? - The role a scope name carries, or null when it has no distinct one.