Skip to content

SPARQL Studio API / SparqlUtils / getSparqlBlockFoldingRanges

Function: getSparqlBlockFoldingRanges()

getSparqlBlockFoldingRanges(query): SparqlFoldingRange[]

Defined in: sparql-utils/src/yasqe.ts:96

Find the foldable brace-delimited blocks ({ ... }) in a SPARQL query: WHERE blocks, SERVICE / OPTIONAL / GRAPH groups, sub-SELECTs, etc. Shared by both editors so folding behaves the same in Monaco and CodeMirror (qlue-ls only reports the prologue via textDocument/foldingRange).

Braces inside line comments (# ...), string literals (single, double and triple-quoted) and IRIs (<...>) are ignored. Only blocks spanning more than one line are returned.

Parameters

query

string

Returns

SparqlFoldingRange[]