Skip to content

TypeQLiteLabels

Defined in: libs/language/src/typeqlite-labels.ts:109

Labels that are plain IDs: every position where TypeQLite names a type without a cross-reference (ADR-008 D5). That covers pipelines (isa, has, links, role players, type patterns), a re-open’s label, and undefine and redefine targets.

Constructors

Name Description
new TypeQLiteLabels() Created with the language’s services by TypeQLiteModule.

Methods

Name Description
candidates() Every definition a label of this kind could name: what completion offers (ADR-008 D5).
resolve() The definitions a label names.
siteAt() The label site under an offset, if there is one.
sitesIn() Every label site in a document.
sitesOfNode() The label sites one AST node holds.
usesOf() Every label site in the definition’s schema that names it: the workspace’s, or its notebook’s.
workspaceHasSchema() Whether the schema defines any type at all.

new TypeQLiteLabels(services): TypeQLiteLabels

Defined in: libs/language/src/typeqlite-labels.ts:119

Created with the language’s services by TypeQLiteModule.

LangiumServices

Langium’s services.

TypeQLiteLabels

candidates(kind, relation?, context?): AstNode[]

Defined in: libs/language/src/typeqlite-labels.ts:171

Every definition a label of this kind could name: what completion offers (ADR-008 D5). A role whose relation is known offers that relation’s roles, inherited ones included.

LabelKind

string

string | URI

AstNode[]


resolve(site): AstNode[]

Defined in: libs/language/src/typeqlite-labels.ts:155

The definitions a label names. Empty when nothing in the workspace defines it.

Pick<LabelSite, "name" | "relation" | "kind"> & object

AstNode[]


siteAt(document, offset): LabelSite | undefined

Defined in: libs/language/src/typeqlite-labels.ts:138

The label site under an offset, if there is one.

LangiumDocument

number

LabelSite | undefined


sitesIn(document): LabelSite[]

Defined in: libs/language/src/typeqlite-labels.ts:126

Every label site in a document.

LangiumDocument

LabelSite[]


sitesOfNode(document, node): LabelSite[]

Defined in: libs/language/src/typeqlite-labels.ts:133

The label sites one AST node holds.

LangiumDocument

AstNode

LabelSite[]


usesOf(target): LabelSite[]

Defined in: libs/language/src/typeqlite-labels.ts:182

Every label site in the definition’s schema that names it: the workspace’s, or its notebook’s.

AstNode

LabelSite[]


workspaceHasSchema(context?): boolean

Defined in: libs/language/src/typeqlite-labels.ts:149

Whether the schema defines any type at all. Without one, nothing can be unknown (ADR-008 D6). The schema is the workspace’s, or, given a notebook cell’s URI, that notebook’s (ADR-012 N4).

string | URI

boolean

TypeDBLite is an independent open-source project, built on TypeDB with thanks. It is not affiliated with, sponsored by, or endorsed by TypeDB Ltd. Released under the MPL-2.0 license.