Skip to main content

Module: languages/getTextFragmentExtractor

Type aliases

TextFragmentExtractor

Ƭ TextFragmentExtractor: (node: SyntaxNode, selection: SelectionWithEditor) => Range | null

Type declaration

▸ (node, selection): Range | null

Parameters
NameType
nodeSyntaxNode
selectionSelectionWithEditor
Returns

Range | null

Defined in

languages/getTextFragmentExtractor.ts:16

Functions

getTextFragmentExtractor

getTextFragmentExtractor(languageId): TextFragmentExtractor

Returns a function which can be used to extract the range of a text fragment from within a parsed language. This function should only return a nominal range for fragments within the document that should be treated like raw text, such as comments strings or error nodes. In these cases we want our surrounding pair algorithm to fall back to a pure raw text-based approach.

Parameters

NameTypeDescription
languageIdstringThe language for which to get the text fragment extractor for

Returns

TextFragmentExtractor

The text fragment extractor for the given language

Defined in

languages/getTextFragmentExtractor.ts:106