Skip to content

Models ​

The features are built on pure functions without React or an editor, which @adecore/editor-react/models exports on their own. The root exports them too. They suit a host that draws its own cards, and tests.

Completion ​

ExportWhat it does
itemsOf, rankCompletions, matchScore, matchDetail, matchedCharactersThe items of an answer, ranked and scored against the typed prefix
prefixFor, identifierPrefix, isIdentifierCharacter, editRangeOfWhat was typed and which range an item replaces
insertionOf, mirroredInsertions, snippetToText, SNIPPET_FORMATWhat an item inserts, at one caret or several
documentationText, completionDocsOf, qualifierOf, qualifiersOfThe documentation and the module or class an item comes from
kindLetterOf, kindToneOf, rowWindow, METHOD_KIND, FUNCTION_KIND, CONSTRUCTOR_KIND, CLASS_KINDHow a row looks and which rows are drawn
planCall, isCallItem, hasParameters, withParentheses, PARAMETER_HINTS_COMMANDAdding the parentheses of a call
parseSnippet, tabOrderA snippet's text and stops

Hover, signatures and problems ​

ExportWhat it does
hoverTextOf, hoverSectionsOf, splitSignatures, splitDocTags, docblockMarkdown, markdownParts, isEmptyHover, locationsOf, sameRangeThe parts of a hover answer
signatureViewOf, parameterSpanA SignatureViewModel and the span of a parameter
severityOf, markerOf, codeLabelOf, problemsAt, neighborProblem, comparePositions, shiftPosition, shiftRange, rangeHoldsDiagnostics as markers and problems
linkTypeNames, isTypeName, declaredNameOf, placesOfName, SYMBOL_LINK_CLASSThe type names in a signature that link to their definition
decodeSemanticTokens, scopesOfSemantic tokens as scopes
ExportWhat it does
peekFilesOf, snippetOf, definitionSnippetOf, distinguishingFolders, visualColumnOf, PEEK_READ_FILESThe files and code of a peek
entriesOf, groupEntries, filterEntries, scoreOf, modeOf, workspaceEntriesOf, groupOfKind, letterOfKind, toneOfKind, SYMBOL_GROUPSThe symbol picker
wordRangeAt, renameTargetOf, occurrencesOf, renameRowsOf, renamePreviewOfRename
actionsOf, groupOf, mergeEntries, isHint, fixableOnLine, diagnosticsAt, previewOf, ACTION_GROUPS, REFACTOR_GROUPSCode actions
declarationsOf, startAfterComments, usagesText, MAX_DECLARATIONSCode vision declarations
mapBlame, authorshipOf, authorsText, shortName, UNCOMMITTEDAuthors from Git blame

Proposals and diffs ​

ExportWhat it does
parseAnswerThe last closed replacement fence of a Markdown answer, and the rest
fitReplacement, endOfInsertionA replacement in the line breaks of the text it replaces
lineSpanOf, inlineRangeOf, isEmptyRange, problemsOnLinesThe stretch a proposal is about
locateSelection, offsetOf, textInRange, replaceRangeFinding and replacing text by position
diffSegments, emphasisOf, replacedWordsThe segments and changed words ChangeReview draws
replaceLines, replaceAllLinesReplacing whole lines
planConflictThe stretches of a three-way merge that need a person
ts
import { parseAnswer } from '@adecore/editor-react/models';

parseAnswer('Shorter:\n```replacement\nconst total = sum(lines);\n```\nIt reads better.');
// { replacement: 'const total = sum(lines);', rest: 'Shorter:\nIt reads better.' }

Find and placement ​

ExportWhat it does
compileFind, matchesIn, stepIndex, EMPTY_FIND_QUERY, MATCH_LIMITA find query checked, run over a text, and stepped through
placePopup, placeBesideWhere a card goes next to a character, inside the window

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