Skip to content

Reference ​

Every name each entry point exports, read from its source. Anything not listed is internal and may change in any release. @adecore/editor/editor.css holds the styles; see Getting started.

@adecore/editor ​

The engine, the Editor contract and its types, the Shiki adapters and the helpers it re-exports from @adecore/editor-core.

NameKindSource
MAX_REPLACEMENT_PAGEconstsearch-protocol
MAX_REPLACEMENT_CHARACTERSconstsearch-protocol
AGENT_COLORSconstattribution
findDocCommentsconstindex
MAX_DOC_COMMENTSconstindex
DocCommenttypeindex
DEFAULT_TODO_WORDSconstindex
findTodosconstindex
TodoMatchtypeindex
TodoOptionstypeindex
detectIndentationconstindex
DetectedIndentationtypeindex
commentSyntaxconstindex
CommentSyntaxtypeindex
createSmartEditorEnginefunctionengine
rememberCopyfunctioncontroller
DEFAULT_SMART_KEYSconstsmart-keys
shikiScopeColorsfunctionshiki-grammar
shikiTokenizersfunctionshiki-grammar
Editortypetypes
EditorAttributionHovertypetypes
EditorAttributionMarktypetypes
EditorMarkColortypetypes
EditorBlocktypetypes
EditorChangeKindtypetypes
EditorChangeMarktypetypes
EditorChangeMarkHovertypetypes
EditorCodeVisiontypetypes
EditorCodeVisionEntrytypetypes
EditorClicktypetypes
EditorCodeBlockOptionstypetypes
EditorClickHandlertypetypes
EditorCommandtypetypes
EditorContextMenutypetypes
EditorEnginetypetypes
EditorFindQuerytypetypes
EditorFoldHintstypetypes
EditorFoldRangeHinttypetypes
EditorFoldOutlinetypetypes
EditorFoldRangetypetypes
EditorFoldSymboltypetypes
EditorFoldstypetypes
EditorFindStatetypetypes
EditorReplaceOptionstypetypes
EditorGutterActiontypetypes
EditorGutterIcontypetypes
EditorGutterMarkertypetypes
EditorReplacementtypetypes
EditorIndentationtypetypes
EditorContentChangetypetypes
EditorHighlighttypetypes
EditorHighlightKindtypetypes
EditorHovertypetypes
EditorGhostTexttypetypes
EditorInlayClicktypetypes
EditorInlayClickHandlertypetypes
EditorInlayHinttypetypes
EditorInlayTargettypetypes
EditorKeyHandlertypetypes
EditorLineActiontypetypes
EditorLineHighlighttypetypes
EditorMarkertypetypes
EditorInputPopuptypetypes
EditorMessagestypetypes
EditorMarkerSeveritytypetypes
EditorRevealtypetypes
EditorRecttypetypes
EditorSmartKeystypetypes
EditorOptionstypetypes
EditorPositiontypetypes
EditorRemoteCursortypetypes
EditorRangetypetypes
EditorApplyEditsOptionstypetypes
EditorSetTextOptionstypetypes
EditorCopytypetypes
EditorPasteOptionstypetypes
EditorPostfixOperandtypetypes
EditorSurroundShapetypetypes
EditorTextPlacetypetypes
EditorUnwrapTargettypetypes
EditorTextChangetypetypes
EditorTrackedRangetypetypes
EditorRunCommandtypetypes
EditorSelectionRangestypetypes
EditorThemetypetypes
EditorViewCommandtypetypes
EditorWhitespaceCleanuptypetypes
EditorWidgettypetypes
EditorZoomtypetypes
FoldRoletypetypes
LineTokentypetypes
LineTokenKindtypetypes
ScopeColorSourcetypetypes
ScopeColorstypetypes
ScopeStyletypetypes
EditorSemanticTokentypetypes
LineTokenizertypetypes
SmartEditorEngineOptionstypetypes
TokenizedLinetypetypes
TokenizerSourcetypetypes
KeyChordtypekeymap-table

@adecore/editor/keymap ​

The key table and the functions that resolve, print and parse chords. See keymaps.

NameKindSource
KeyChordtypekeymap-table
TakenKeytypekeymap-table
KeyBindingtypekeymap-table
KEYMAPconstkeymap-table
KeymapIdtypekeymap-table
OptionalKeymapIdtypekeymap-table
Keymaptypekeymap-table
KeymapOverridestypekeymap-table
KEYMAP_IDSconstkeymap-table
resolveKeymapfunctionkeymap-table
chordOffunctionkeymap-table
parseChordfunctionkeymap-table
typesInsteadOfChordfunctionkeymap-table

@adecore/editor/shiki ​

The Shiki adapters and the steps behind them, for a code viewer that colors the same way. See Theme and syntax.

NameKindSource
documentLanguageOffunctionshiki-grammar
loadGrammarfunctionshiki-grammar
shikiScopeColorsfunctionshiki-grammar
shikiTokenizersfunctionshiki-grammar
shikiDocumentHighlighterfunctionshiki-document
shikiDocumentTokensfunctionshiki-document
ShikiDocumentTokenOptionstypeshiki-document

@adecore/editor/shiki-worker ​

Syntax tokens for a diff, served from a worker. See diff syntax in a worker.

NameKindSource
DiffSyntaxDocumenttypeshiki-worker
DiffSyntaxInputtypeshiki-worker
DiffSyntaxTokenstypeshiki-worker
DiffSyntaxOutputtypeshiki-worker
DiffSyntaxServicetypeshiki-worker
DiffSyntaxServiceOptionstypeshiki-worker
lineTokensOffunctionshiki-worker
createSyntaxServicefunctionshiki-worker
DiffSyntaxWorkerEndpointtypeshiki-worker
serveDiffSyntaxfunctionshiki-worker

@adecore/editor/search-worker ​

Regular expression search off the page. See the search worker.

NameKindSource
createSearchClientfunctionsearch-client
EditorSearchErrorclasssearch-client
EditorSearchClienttypesearch-client
EditorSearchClientOptionstypesearch-client
EditorSearchErrorKindtypesearch-client
EditorSearchInputtypesearch-protocol
EditorSearchOptionstypesearch-protocol
EditorSearchOutputtypesearch-protocol
EditorSearchResulttypesearch-protocol
EditorSearchSnapshottypesearch-protocol
EditorSearchMatchtypesearch-protocol
EditorSearchRangetypesearch-protocol
EditorSearchNextOptionstypesearch-protocol
EditorSearchReplacementOptionstypesearch-protocol
EditorSearchReplacementstypesearch-protocol
EditorSearchWorkerEndpointtypesearch-worker
serveEditorSearchfunctionsearch-worker

@adecore/editor/worker-client ​

The request lifecycle the search client is built on. See a worker client of your own.

NameKindSource
WorkerRequestPorttypeworker-client
WorkerRequestErrorKindtypeworker-client
WorkerRequestErrorclassworker-client
WorkerRequestOptionstypeworker-client
WorkerRequestClienttypeworker-client
createWorkerRequestClientfunctionworker-client

@adecore/editor/fake ​

An Editor without a DOM, for tests of host code. See Testing.

NameKindSource
FakeEditorclassfake
FakeEditorEngineclassfake

@adecore/editor/testing ​

The real editor on a LinkeDOM page. See Testing.

NameKindSource
createPagefunctiontesting
KeyOptionstypetesting
pressfunctiontesting
releasefunctiontesting
typeIntofunctiontesting
clipboardfunctiontesting
pointerfunctiontesting
MountedEditortypetesting
mountEditorfunctiontesting

Compatibility ​

An Editor implemented outside this package needs setInputPopup, announce, setLineLabels and setMessages. Many newer methods are optional, so a host wrapping an older editor checks for them first: isReadOnly, getBaseLineHeight, setTodoWords, setFontSize, getFontSize, onFontSizeChange, cleanUpWhitespace, markSaved, setDeclarations, onNavigate, hasFocus, setWordSources, the clipboard members onCopy and paste, and the lexical queries. EditorMessages gained fold and unfold; the messages option takes a Partial<EditorMessages>.

Newer KEYMAP commands are OptionalKeymapIds, so a full Keymap written before them stays valid and chordOf reads the built-in chord. Their defaults:

CommandmacOSOther
moveStatementUp, moveStatementDownMod+Shift+ArrowUp, ArrowDownthe same
completeCurrentStatementMod+Shift+Enterthe same
hippieCompletion, hippieBackwardCompletionAlt+/, Alt+Shift+/the same
methodUp, methodDownCtrl+Shift+ArrowUp, ArrowDownAlt+ArrowUp, ArrowDown
codeBlockStart, codeBlockEndMod+Alt+[, Mod+Alt+]Ctrl+[, Ctrl+]
codeBlockStartWithSelection, codeBlockEndWithSelectionMod+Alt+Shift+[, Mod+Alt+Shift+]Ctrl+Shift+[, Ctrl+Shift+]
nextChange, previousChangeCtrl+Alt+Shift+ArrowDown, ArrowUpthe same
lastEditLocation, run by the language side of @adecore/editor-reactMod+Shift+Backspacethe same
pasteFromHistory, run by the language sideMod+Shift+Vthe same
pasteAsPlainText, an EditorViewCommand for runCommandMod+Alt+Shift+Vthe same
typeHierarchyCtrl+Hthe same
toggleRenderedDocsCtrl+Alt+Qthe same
insertLiveTemplate, surroundWith, surroundWithLiveTemplate, unwrapMod+J, Mod+Alt+T, Mod+Alt+J, Mod+Shift+Deletethe same
nextEditLocation, wrapWithAbbreviation, saveAsLiveTemplate, increaseFontSize, decreaseFontSize, resetFontSize, sortLines, reverseLines, uniqueLines, convertIndentsToSpaces, convertIndentsToTabsnonenone

Two defaults changed:

  • On macOS selectTextStart and selectTextEnd lost Meta+Shift+ArrowUp and ArrowDown to moveStatementUp and moveStatementDown. Mod+Shift+Home and Mod+Shift+End still select to the text edges. To keep the old chords, pass resolveKeymap({ selectTextStart: { mac: 'Meta+Shift+ArrowUp' }, selectTextEnd: { mac: 'Meta+Shift+ArrowDown' }, moveStatementUp: { mac: null }, moveStatementDown: { mac: null } }).
  • Off macOS shrinkSelection is Ctrl+Shift+W, since Alt+ArrowUp and Alt+ArrowDown are Method Up and Down. To keep the old chord, pass resolveKeymap({ shrinkSelection: { other: 'Alt+ArrowDown' } }) and move methodDown and methodUp.

ProjectLanguage.acquire takes a fourth parameter, AcquireOptions ({ serve?: boolean }, default true), which a wrapping service must forward to super.acquire. EditorLanguageOptions gained serve, and EditorLanguage gained served and service. Features ask language.service, so a document acquired with serve: false never reaches the project's service. An EditorLanguage can exist for a plain-text file, so read language.served to know whether a server handles it. ProjectLanguage.openEditors() lists the editors that hold a document.

Other additions on the language side: LanguageHost gained editHistoryLimit and clipboard, ProjectLanguage gained edits (an EditLocations) and clipboard, HistoryFeature gained lastEdit and nextEdit, and EditorLanguage gained pasteHistory. PickView gained query and chosen, so a host building one by hand adds them. PickSpec gained filter, multiple, acceptMany and remove, PickRow gained search and PickPreview gained kind.

Breaking: Wrap with Abbreviation has no default chord ​

wrapWithAbbreviation lost Mod+Alt+J to surroundWithLiveTemplate, as in IntelliJ, where Emmet is a row of that list. The command still works when a host binds a chord, and language.markup.startWrap() opens it from a menu.

  • chordOf('wrapWithAbbreviation', ...) now returns null. Print the chord of surroundWithLiveTemplate instead.
  • To give it a chord, override it in resolveKeymap, for example { wrapWithAbbreviation: { mac: 'Mod+Alt+J', other: 'Mod+Alt+J' } }, and move surroundWithLiveTemplate, since no two commands may share a chord.

Licenses and third-party notices are listed in each package.