Editor
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Editor(
container,options?):Editor
Parameters
Section titled “Parameters”container
Section titled “container”HTMLElement
options?
Section titled “options?”Returns
Section titled “Returns”Editor
Methods
Section titled “Methods”addPlugin()
Section titled “addPlugin()”addPlugin(
plugin):EditorDisposable
Parameters
Section titled “Parameters”plugin
Section titled “plugin”Returns
Section titled “Returns”applyEdit()
Section titled “applyEdit()”applyEdit(
edit,tokens,textSnapshot):void
textSnapshot is the text after edit; a detached view renders it. On a buffer session the edit
goes through the session, which supplies its own.
Parameters
Section titled “Parameters”tokens
Section titled “tokens”textSnapshot
Section titled “textSnapshot”Returns
Section titled “Returns”void
attachSession()
Section titled “attachSession()”attachSession(
session,options?):void
Parameters
Section titled “Parameters”session
Section titled “session”options?
Section titled “options?”Returns
Section titled “Returns”void
authorEdits()
Section titled “authorEdits()”authorEdits(
author):EditorDisposable
Parameters
Section titled “Parameters”author
Section titled “author”Returns
Section titled “Returns”captureSnapshot()
Section titled “captureSnapshot()”Call Signature
Section titled “Call Signature”captureSnapshot(
options):DocumentPaintCapture
Parameters
Section titled “Parameters”options
Section titled “options”"document"
Returns
Section titled “Returns”Call Signature
Section titled “Call Signature”captureSnapshot(
options?):any
Parameters
Section titled “Parameters”options?
Section titled “options?”"viewport"
Returns
Section titled “Returns”any
clear()
Section titled “clear()”clear():
void
Returns
Section titled “Returns”void
clearDocument()
Section titled “clearDocument()”clearDocument():
void
Returns
Section titled “Returns”void
closeFind()
Section titled “closeFind()”closeFind():
boolean
Returns
Section titled “Returns”boolean
cursorRedo()
Section titled “cursorRedo()”cursorRedo():
boolean
Returns
Section titled “Returns”boolean
cursorUndo()
Section titled “cursorUndo()”cursorUndo():
boolean
Returns the carets, and the view, to where they were before the last caret move.
Returns
Section titled “Returns”boolean
detachSession()
Section titled “detachSession()”detachSession():
void
Returns
Section titled “Returns”void
dispatchCommand()
Section titled “dispatchCommand()”dispatchCommand(
command,context?):boolean
Parameters
Section titled “Parameters”command
Section titled “command”context?
Section titled “context?”Returns
Section titled “Returns”boolean
dispose()
Section titled “dispose()”dispose():
void
Returns
Section titled “Returns”void
edit()
Section titled “edit()”edit(
editOrEdits,options?):void
Parameters
Section titled “Parameters”editOrEdits
Section titled “editOrEdits”options?
Section titled “options?”DocumentSessionApplyEditsOptions
Returns
Section titled “Returns”void
findNext()
Section titled “findNext()”findNext():
boolean
Returns
Section titled “Returns”boolean
findPrevious()
Section titled “findPrevious()”findPrevious():
boolean
Returns
Section titled “Returns”boolean
focus()
Section titled “focus()”focus():
void
Returns
Section titled “Returns”void
fold()
Section titled “fold()”fold(
offset?):boolean
Parameters
Section titled “Parameters”offset?
Section titled “offset?”number
Returns
Section titled “Returns”boolean
foldAll()
Section titled “foldAll()”foldAll():
boolean
Returns
Section titled “Returns”boolean
getBufferSession()
Section titled “getBufferSession()”getBufferSession():
EditorBufferSession|null
Returns
Section titled “Returns”EditorBufferSession | null
getCommandDeclarations()
Section titled “getCommandDeclarations()”getCommandDeclarations(): readonly (
EditorCommandDeclaration<"find"|"insertNewlineAndIndent"|"copy"|"cut"|"paste"|"markdown.indentListItem"|"markdown.outdentListItem"|"lsp.rename.accept"|"lsp.rename.cancel"|"tooltip.hide"|"tooltip.scrollUp"|"tooltip.scrollDown"|"tooltip.pageUp"|"tooltip.pageDown"|"tooltip.scrollStart"|"tooltip.scrollEnd"|"markdown.openLink"|"markdown.bold"|"markdown.italic"|"markdown.strikethrough"|"markdown.code"|"markdown.link"|"markdown.heading"|"markdown.bulletList"|"markdown.orderedList"|"markdown.taskList"|"markdown.toggleTask"|"markdown.quote"|"markdown.codeBlock"|"undo"|"redo"|"jumpBack"|"jumpForward"|"cursorUndo"|"cursorRedo"|"findReplace"|"findNext"|"findPrevious"|"editor.action.goToDefinition"|"editor.action.goToReferences"|"editor.action.peekDefinition"|"editor.action.revealDefinitionAside"|"editor.action.goToImplementation"|"editor.action.goToTypeDefinition"|"editor.action.showHover"|"editor.action.marker.next"|"editor.action.marker.prev"|"merge-conflict.accept.current"|"merge-conflict.accept.incoming"|"merge-conflict.accept.both"|"merge-conflict.accept.selection"|"merge-conflict.accept.all-current"|"merge-conflict.accept.all-incoming"|"merge-conflict.accept.all-both"|"merge-conflict.next"|"merge-conflict.previous"|"merge-conflict.compare"|"closeFind"|"toggleFindCaseSensitive"|"toggleFindWholeWord"|"toggleFindRegex"|"toggleFindInSelection"|"togglePreserveCase"|"replaceOne"|"replaceAll"|"selectAllMatches"|"selectAll"|"editor.action.smartSelect.expand"|"editor.action.smartSelect.shrink"|"addNextOccurrence"|"clearSecondarySelections"|"editor.action.insertCursorAbove"|"editor.action.insertCursorBelow"|"editor.action.selectHighlights"|"editor.action.changeAll"|"editor.action.jumpToBracket"|"editor.action.toggleWordWrap"|"editor.action.toggleTabFocusMode"|"editor.action.formatDocument"|"editor.action.rename"|"editor.action.autoFix"|"editor.action.inlineSuggest.commit"|"editor.action.inlineSuggest.acceptNextWord"|"editor.action.triggerSuggest"|"selectNextSuggestion"|"selectPrevSuggestion"|"selectNextPageSuggestion"|"selectPrevPageSuggestion"|"acceptSelectedSuggestion"|"hideSuggestWidget"|"closeParameterHints"|"showNextParameterHint"|"showPrevParameterHint"|"editor.action.moveSelectionToNextFindMatch"|"editor.fold"|"editor.unfold"|"editor.foldRecursively"|"editor.unfoldRecursively"|"editor.foldAll"|"editor.unfoldAll"|"editor.foldLevel1"|"editor.foldLevel2"|"editor.foldLevel3"|"editor.foldLevel4"|"editor.foldLevel5"|"editor.foldLevel6"|"editor.foldLevel7"|"editor.createFoldingRangeFromSelection"|"editor.removeManualFoldingRanges"|"deleteBackward"|"deleteForward"|"deleteWordLeft"|"deleteWordRight"|"deleteWordPartLeft"|"deleteWordPartRight"|"editor.action.commentLine"|"editor.action.blockComment"|"editor.action.indentLines"|"editor.action.outdentLines"|"editor.action.reindentlines"|"editor.action.reindentselectedlines"|"editor.action.deleteLines"|"editor.action.copyLinesUpAction"|"editor.action.copyLinesDownAction"|"editor.action.moveLinesUpAction"|"editor.action.moveLinesDownAction"|"editor.action.insertLineBefore"|"editor.action.insertLineAfter"|"editor.action.trimTrailingWhitespace"|"editor.action.sortLinesAscending"|"editor.action.sortLinesDescending"|"editor.action.joinLines"|"editor.action.duplicateSelection"|"editor.action.transformToUppercase"|"editor.action.transformToLowercase"|"editor.action.transformToTitlecase"|"cursorWordPartLeft"|"cursorWordPartRight"|"cursorWordPartLeftSelect"|"cursorWordPartRightSelect"|"indentSelection"|"outdentSelection"|"cursorLeft"|"cursorRight"|"cursorUp"|"cursorDown"|"selectLeft"|"selectRight"|"selectUp"|"selectDown"|"cursorWordLeft"|"cursorWordRight"|"selectWordLeft"|"selectWordRight"|"cursorLineStart"|"cursorLineEnd"|"selectLineStart"|"selectLineEnd"|"cursorPageUp"|"cursorPageDown"|"selectPageUp"|"selectPageDown"|"cursorDocumentStart"|"cursorDocumentEnd"|"selectDocumentStart"|"selectDocumentEnd"|"cursorColumnSelectLeft"|"cursorColumnSelectRight"|"cursorColumnSelectUp"|"cursorColumnSelectDown"|"cursorColumnSelectPageUp"|"cursorColumnSelectPageDown"> |EditorContributedCommandDeclaration)[]
The commands this editor knows: every built-in, then those its plugins contribute.
Returns
Section titled “Returns”readonly (EditorCommandDeclaration<"find" | "insertNewlineAndIndent" | "copy" | "cut" | "paste" | "markdown.indentListItem" | "markdown.outdentListItem" | "lsp.rename.accept" | "lsp.rename.cancel" | "tooltip.hide" | "tooltip.scrollUp" | "tooltip.scrollDown" | "tooltip.pageUp" | "tooltip.pageDown" | "tooltip.scrollStart" | "tooltip.scrollEnd" | "markdown.openLink" | "markdown.bold" | "markdown.italic" | "markdown.strikethrough" | "markdown.code" | "markdown.link" | "markdown.heading" | "markdown.bulletList" | "markdown.orderedList" | "markdown.taskList" | "markdown.toggleTask" | "markdown.quote" | "markdown.codeBlock" | "undo" | "redo" | "jumpBack" | "jumpForward" | "cursorUndo" | "cursorRedo" | "findReplace" | "findNext" | "findPrevious" | "editor.action.goToDefinition" | "editor.action.goToReferences" | "editor.action.peekDefinition" | "editor.action.revealDefinitionAside" | "editor.action.goToImplementation" | "editor.action.goToTypeDefinition" | "editor.action.showHover" | "editor.action.marker.next" | "editor.action.marker.prev" | "merge-conflict.accept.current" | "merge-conflict.accept.incoming" | "merge-conflict.accept.both" | "merge-conflict.accept.selection" | "merge-conflict.accept.all-current" | "merge-conflict.accept.all-incoming" | "merge-conflict.accept.all-both" | "merge-conflict.next" | "merge-conflict.previous" | "merge-conflict.compare" | "closeFind" | "toggleFindCaseSensitive" | "toggleFindWholeWord" | "toggleFindRegex" | "toggleFindInSelection" | "togglePreserveCase" | "replaceOne" | "replaceAll" | "selectAllMatches" | "selectAll" | "editor.action.smartSelect.expand" | "editor.action.smartSelect.shrink" | "addNextOccurrence" | "clearSecondarySelections" | "editor.action.insertCursorAbove" | "editor.action.insertCursorBelow" | "editor.action.selectHighlights" | "editor.action.changeAll" | "editor.action.jumpToBracket" | "editor.action.toggleWordWrap" | "editor.action.toggleTabFocusMode" | "editor.action.formatDocument" | "editor.action.rename" | "editor.action.autoFix" | "editor.action.inlineSuggest.commit" | "editor.action.inlineSuggest.acceptNextWord" | "editor.action.triggerSuggest" | "selectNextSuggestion" | "selectPrevSuggestion" | "selectNextPageSuggestion" | "selectPrevPageSuggestion" | "acceptSelectedSuggestion" | "hideSuggestWidget" | "closeParameterHints" | "showNextParameterHint" | "showPrevParameterHint" | "editor.action.moveSelectionToNextFindMatch" | "editor.fold" | "editor.unfold" | "editor.foldRecursively" | "editor.unfoldRecursively" | "editor.foldAll" | "editor.unfoldAll" | "editor.foldLevel1" | "editor.foldLevel2" | "editor.foldLevel3" | "editor.foldLevel4" | "editor.foldLevel5" | "editor.foldLevel6" | "editor.foldLevel7" | "editor.createFoldingRangeFromSelection" | "editor.removeManualFoldingRanges" | "deleteBackward" | "deleteForward" | "deleteWordLeft" | "deleteWordRight" | "deleteWordPartLeft" | "deleteWordPartRight" | "editor.action.commentLine" | "editor.action.blockComment" | "editor.action.indentLines" | "editor.action.outdentLines" | "editor.action.reindentlines" | "editor.action.reindentselectedlines" | "editor.action.deleteLines" | "editor.action.copyLinesUpAction" | "editor.action.copyLinesDownAction" | "editor.action.moveLinesUpAction" | "editor.action.moveLinesDownAction" | "editor.action.insertLineBefore" | "editor.action.insertLineAfter" | "editor.action.trimTrailingWhitespace" | "editor.action.sortLinesAscending" | "editor.action.sortLinesDescending" | "editor.action.joinLines" | "editor.action.duplicateSelection" | "editor.action.transformToUppercase" | "editor.action.transformToLowercase" | "editor.action.transformToTitlecase" | "cursorWordPartLeft" | "cursorWordPartRight" | "cursorWordPartLeftSelect" | "cursorWordPartRightSelect" | "indentSelection" | "outdentSelection" | "cursorLeft" | "cursorRight" | "cursorUp" | "cursorDown" | "selectLeft" | "selectRight" | "selectUp" | "selectDown" | "cursorWordLeft" | "cursorWordRight" | "selectWordLeft" | "selectWordRight" | "cursorLineStart" | "cursorLineEnd" | "selectLineStart" | "selectLineEnd" | "cursorPageUp" | "cursorPageDown" | "selectPageUp" | "selectPageDown" | "cursorDocumentStart" | "cursorDocumentEnd" | "selectDocumentStart" | "selectDocumentEnd" | "cursorColumnSelectLeft" | "cursorColumnSelectRight" | "cursorColumnSelectUp" | "cursorColumnSelectDown" | "cursorColumnSelectPageUp" | "cursorColumnSelectPageDown"> | EditorContributedCommandDeclaration)[]
getContentHeight()
Section titled “getContentHeight()”getContentHeight():
number
Returns
Section titled “Returns”number
getFeature()
Section titled “getFeature()”getFeature<
T>(token):T|null
A capability a plugin registered on this editor, such as spellcheck; null while none has.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”Returns
Section titled “Returns”T | null
getHotkeysHost()
Section titled “getHotkeysHost()”getHotkeysHost():
EditorHotkeysHost
The dispatcher and focus node that own this editor’s keyboard commands.
Returns
Section titled “Returns”getInputElement()
Section titled “getInputElement()”getInputElement():
HTMLElement
Returns
Section titled “Returns”HTMLElement
getKeymapContext()
Section titled “getKeymapContext()”getKeymapContext():
EditorKeymapContext
Returns
Section titled “Returns”getMergeConflicts()
Section titled “getMergeConflicts()”getMergeConflicts(): readonly
MergeConflictRegion[]
Returns
Section titled “Returns”readonly MergeConflictRegion[]
getPresentationState()
Section titled “getPresentationState()”getPresentationState():
"provisional"|"live"|"empty"
Returns
Section titled “Returns”"provisional" | "live" | "empty"
getScrollPosition()
Section titled “getScrollPosition()”getScrollPosition():
Required<EditorScrollPosition>
Returns
Section titled “Returns”Required<EditorScrollPosition>
getSelections()
Section titled “getSelections()”getSelections(): readonly
EditorResolvedSelection[]
Every selection as document offsets, primary first.
Returns
Section titled “Returns”readonly EditorResolvedSelection[]
getState()
Section titled “getState()”getState():
EditorState
Returns
Section titled “Returns”getSyntaxRecords()
Section titled “getSyntaxRecords()”getSyntaxRecords():
EditorSyntaxRecords|null
Parsed records for this exact text revision; absent while analysis catches up.
Returns
Section titled “Returns”EditorSyntaxRecords | null
getTextSnapshot()
Section titled “getTextSnapshot()”getTextSnapshot():
TextSnapshot
Returns
Section titled “Returns”isTabMovesFocusEnabled()
Section titled “isTabMovesFocusEnabled()”isTabMovesFocusEnabled():
boolean
Returns
Section titled “Returns”boolean
isWordWrapEnabled()
Section titled “isWordWrapEnabled()”isWordWrapEnabled():
boolean
Returns
Section titled “Returns”boolean
jumpBack()
Section titled “jumpBack()”jumpBack():
boolean
Returns
Section titled “Returns”boolean
jumpForward()
Section titled “jumpForward()”jumpForward():
boolean
Returns
Section titled “Returns”boolean
jumpTo()
Section titled “jumpTo()”jumpTo(
anchor,head?,cause?):void
Parameters
Section titled “Parameters”anchor
Section titled “anchor”number
number
cause?
Section titled “cause?”Returns
Section titled “Returns”void
markerAtPoint()
Section titled “markerAtPoint()”markerAtPoint(
clientX,clientY):EditorMarkerHit|null
Parameters
Section titled “Parameters”clientX
Section titled “clientX”number
clientY
Section titled “clientY”number
Returns
Section titled “Returns”EditorMarkerHit | null
materializeFullText()
Section titled “materializeFullText()”materializeFullText():
string
O(document length) on every call, never cached; save and export are what it is for.
Returns
Section titled “Returns”string
onDidChangeContentHeight()
Section titled “onDidChangeContentHeight()”onDidChangeContentHeight(
listener):EditorDisposable
Called with the rows’ total height in pixels whenever it changes: lines added or removed, wrap reflowing, the font changing. A host that grows with its text sizes itself from this.
Parameters
Section titled “Parameters”listener
Section titled “listener”(height) => void
Returns
Section titled “Returns”onDidScroll()
Section titled “onDidScroll()”onDidScroll(
listener):EditorDisposable
Called with the position after it changes, from a gesture, a programmatic move or a clamp. The virtualizer has already folded the scroll in, so the position is current, and nothing throttles it.
Parameters
Section titled “Parameters”listener
Section titled “listener”(position) => void
Returns
Section titled “Returns”onDidTransaction()
Section titled “onDidTransaction()”onDidTransaction(
listener):EditorDisposable
Each logical edit, before view updates can coalesce it. The registration survives document swaps.
Parameters
Section titled “Parameters”listener
Section titled “listener”(event) => void
Returns
Section titled “Returns”openDocument()
Section titled “openDocument()”openDocument(
document):void
Parameters
Section titled “Parameters”document
Section titled “document”Returns
Section titled “Returns”void
openFind()
Section titled “openFind()”openFind():
boolean
Returns
Section titled “Returns”boolean
openFindReplace()
Section titled “openFindReplace()”openFindReplace():
boolean
Returns
Section titled “Returns”boolean
reconcile()
Section titled “reconcile()”reconcile(
base,batches,options):void
Parameters
Section titled “Parameters”PieceTableTreeSnapshot
batches
Section titled “batches”readonly readonly TextEdit[][]
options
Section titled “options”DocumentSessionReconcileOptions
Returns
Section titled “Returns”void
registerKeymapNode()
Section titled “registerKeymapNode()”registerKeymapNode(
options):object
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”object
dispose
Section titled “dispose”dispose: () =>
void
Returns
Section titled “Returns”void
removePlugin()
Section titled “removePlugin()”removePlugin(
plugin):boolean
Parameters
Section titled “Parameters”plugin
Section titled “plugin”Returns
Section titled “Returns”boolean
replaceAll()
Section titled “replaceAll()”replaceAll():
boolean
Returns
Section titled “Returns”boolean
replaceOne()
Section titled “replaceOne()”replaceOne():
boolean
Returns
Section titled “Returns”boolean
resolveMergeConflict()
Section titled “resolveMergeConflict()”resolveMergeConflict(
index,resolution):boolean
Parameters
Section titled “Parameters”number
resolution
Section titled “resolution”Returns
Section titled “Returns”boolean
revealMergeConflict()
Section titled “revealMergeConflict()”revealMergeConflict(
index):boolean
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”boolean
rowAtPoint()
Section titled “rowAtPoint()”rowAtPoint(
clientX,clientY):EditorPointHit|null
Parameters
Section titled “Parameters”clientX
Section titled “clientX”number
clientY
Section titled “clientY”number
Returns
Section titled “Returns”EditorPointHit | null
runInOperation()
Section titled “runInOperation()”runInOperation<
T>(run):T
Runs run as a single mutating pass. Whatever it changes, the caret is
revealed once, the DOM selection is written back once and listeners hear
once, at the end — so a sequence of edits costs one visual update instead of
one each. Calls made from inside a pass join it rather than opening another.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”() => T
Returns
Section titled “Returns”T
selectAllMatches()
Section titled “selectAllMatches()”selectAllMatches():
boolean
Returns
Section titled “Returns”boolean
setContent()
Section titled “setContent()”setContent(
text):void
On a buffer session this replaces the buffer’s text as one undoable edit every view sees.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
setDetectIndentation()
Section titled “setDetectIndentation()”setDetectIndentation(
enabled):void
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
Returns
Section titled “Returns”void
setDocument()
Section titled “setDocument()”setDocument(
document):void
Parameters
Section titled “Parameters”document
Section titled “document”Returns
Section titled “Returns”void
setEditability()
Section titled “setEditability()”setEditability(
editability):void
Parameters
Section titled “Parameters”editability
Section titled “editability”Returns
Section titled “Returns”void
setFolding()
Section titled “setFolding()”setFolding(
enabled):void
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
Returns
Section titled “Returns”void
setFoldMap()
Section titled “setFoldMap()”setFoldMap(
foldMap):void
Parameters
Section titled “Parameters”foldMap
Section titled “foldMap”FoldMap | null
Returns
Section titled “Returns”void
setFontFamily()
Section titled “setFontFamily()”setFontFamily(
fontFamily):void
A CSS font-family list; undefined hands the face back to the stylesheet.
Parameters
Section titled “Parameters”fontFamily
Section titled “fontFamily”string | undefined
Returns
Section titled “Returns”void
setFontSize()
Section titled “setFontSize()”setFontSize(
fontSize):void
Undefined hands the size back to the stylesheet.
Parameters
Section titled “Parameters”fontSize
Section titled “fontSize”number | undefined
Returns
Section titled “Returns”void
setGutterLeadingInset()
Section titled “setGutterLeadingInset()”setGutterLeadingInset(
inset):void
Empty pixels before the first gutter lane; row decorations tint them. 0 removes the inset.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
setGutterScroll()
Section titled “setGutterScroll()”setGutterScroll(
mode):void
Switch all gutter lanes between the viewport edge and the horizontally scrolling text.
Parameters
Section titled “Parameters”NonNullable<EditorGutterScroll | undefined>
Returns
Section titled “Returns”void
setHiddenCharacters()
Section titled “setHiddenCharacters()”setHiddenCharacters(
mode):void
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
setInlineMap()
Section titled “setInlineMap()”setInlineMap(
inlineMap):void
Installs the inline replacements this document renders instead of parts of its own text — the entry point a markdown live-preview view drives. Passing null restores raw buffer text.
Parameters
Section titled “Parameters”inlineMap
Section titled “inlineMap”InlineMap | null
Returns
Section titled “Returns”void
setInlineReplacementProvider()
Section titled “setInlineReplacementProvider()”setInlineReplacementProvider(
provider,options?):void
Registers a provider that turns the document’s syntax captures into inline replacements. The map is rebuilt whenever fresh captures land, so a markdown view stays in step with the parse without the host scheduling anything itself. Passing null removes the transform.
Parameters
Section titled “Parameters”provider
Section titled “provider”EditorInlineReplacementProvider | null
options?
Section titled “options?”EditorInlineReplacementProviderOptions
Returns
Section titled “Returns”void
setInlineSuggestion()
Section titled “setInlineSuggestion()”setInlineSuggestion(
edit):boolean
Offers an inline suggestion, drawn in front of the reader as the part of it the document does not already hold. Passing null takes back whatever is showing.
Parameters
Section titled “Parameters”TextEdit | null
Returns
Section titled “Returns”boolean
setKeymap()
Section titled “setKeymap()”setKeymap(
keymap):void
Parameters
Section titled “Parameters”keymap
Section titled “keymap”EditorKeymapOptions | undefined
Returns
Section titled “Returns”void
setLineHeight()
Section titled “setLineHeight()”setLineHeight(
lineHeight):void
Parameters
Section titled “Parameters”lineHeight
Section titled “lineHeight”number
Returns
Section titled “Returns”void
setPlugins()
Section titled “setPlugins()”setPlugins(
plugins):void
Parameters
Section titled “Parameters”plugins
Section titled “plugins”readonly EditorPlugin[]
Returns
Section titled “Returns”void
setPresentationReady()
Section titled “setPresentationReady()”setPresentationReady(
ready):void
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
setRangeDecorations()
Section titled “setRangeDecorations()”setRangeDecorations(
decorations):void
Parameters
Section titled “Parameters”decorations
Section titled “decorations”readonly EditorRangeDecoration[]
Returns
Section titled “Returns”void
setRowDecorations()
Section titled “setRowDecorations()”setRowDecorations(
decorations):void
Parameters
Section titled “Parameters”decorations
Section titled “decorations”ReadonlyMap<number, VirtualizedTextRowDecoration>
Returns
Section titled “Returns”void
setRowGap()
Section titled “setRowGap()”setRowGap(
rowGap):void
Parameters
Section titled “Parameters”rowGap
Section titled “rowGap”number
Returns
Section titled “Returns”void
setScrollMode()
Section titled “setScrollMode()”setScrollMode(
scrollMode):void
Parameters
Section titled “Parameters”scrollMode
Section titled “scrollMode”VirtualizedTextViewScrollMode | undefined
Returns
Section titled “Returns”void
setScrollPosition()
Section titled “setScrollPosition()”setScrollPosition(
scrollPosition):void
Parameters
Section titled “Parameters”scrollPosition
Section titled “scrollPosition”Returns
Section titled “Returns”void
setSelection()
Section titled “setSelection()”setSelection(
anchor,head?,options?):void
Parameters
Section titled “Parameters”anchor
Section titled “anchor”number
number
options?
Section titled “options?”Returns
Section titled “Returns”void
setSnapshot()
Section titled “setSnapshot()”setSnapshot(
snapshot,documentKey):void
Parameters
Section titled “Parameters”snapshot
Section titled “snapshot”string | null
documentKey
Section titled “documentKey”string | null
Returns
Section titled “Returns”void
setSuspiciousCharacters()
Section titled “setSuspiciousCharacters()”setSuspiciousCharacters(
options):void
Parameters
Section titled “Parameters”options
Section titled “options”EditorSuspiciousCharactersOptions | undefined
Returns
Section titled “Returns”void
setSyntaxFolds()
Section titled “setSyntaxFolds()”setSyntaxFolds(
folds):void
Parameters
Section titled “Parameters”readonly FoldRange[]
Returns
Section titled “Returns”void
setTabMovesFocus()
Section titled “setTabMovesFocus()”setTabMovesFocus(
enabled):boolean
Gives Tab back to the page, or takes it for indentation again. Returns the state in effect afterwards. Nothing is announced from here: a host writing its own controls says what it did in its own words, and the key that toggles this from inside the editor speaks for itself.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
Returns
Section titled “Returns”boolean
setTabSize()
Section titled “setTabSize()”setTabSize(
tabSize):void
Columns a tab spans, and the fallback the open document’s indentation is guessed against, so a document that gave no sign of its own follows the new width. Undefined is the default, 4.
Parameters
Section titled “Parameters”tabSize
Section titled “tabSize”number | undefined
Returns
Section titled “Returns”void
setText()
Section titled “setText()”setText(
text,options?):void
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”void
setTheme()
Section titled “setTheme()”setTheme(
theme):void
Parameters
Section titled “Parameters”EditorTheme | null | undefined
Returns
Section titled “Returns”void
setTokens()
Section titled “setTokens()”setTokens(
tokens):void
Parameters
Section titled “Parameters”tokens
Section titled “tokens”Returns
Section titled “Returns”void
setWordWrap()
Section titled “setWordWrap()”setWordWrap(
enabled):boolean
Turns soft wrap on or off. Returns the state actually in effect afterwards.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
Returns
Section titled “Returns”boolean
syncText()
Section titled “syncText()”syncText(
text,options?):void
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”void
textOffsetFromPoint()
Section titled “textOffsetFromPoint()”textOffsetFromPoint(
clientX,clientY):number|null
Parameters
Section titled “Parameters”clientX
Section titled “clientX”number
clientY
Section titled “clientY”number
Returns
Section titled “Returns”number | null
toggleFold()
Section titled “toggleFold()”toggleFold(
offset?):boolean
Parameters
Section titled “Parameters”offset?
Section titled “offset?”number
Returns
Section titled “Returns”boolean
unfold()
Section titled “unfold()”unfold(
offset?):boolean
Parameters
Section titled “Parameters”offset?
Section titled “offset?”number
Returns
Section titled “Returns”boolean
unfoldAll()
Section titled “unfoldAll()”unfoldAll():
boolean
Returns
Section titled “Returns”boolean