inspector/problems#

Classes#

ProblemError#

Defined in: editor/src/inspector/problems.ts:74

Thrown inside a recursive reader, caught at its boundary and returned as a result.

Extends#

  • Error

Constructors#

Constructor#

new ProblemError(problem): ProblemError

Defined in: editor/src/inspector/problems.ts:77

Parameters#
problem#

InspectorProblem

Returns#

ProblemError

Overrides#

Error.constructor

Properties#

problem#

readonly problem: InspectorProblem

Defined in: editor/src/inspector/problems.ts:75

Interfaces#

InspectorProblem#

Defined in: editor/src/inspector/problems.ts:23

A problem with its path into the manifest, plus the 1-based line and column of the text for a syntax error. Command refusals keep core’s codes.

Properties#

code#

readonly code: ErrorCode | "syntax_error" | "not_representable" | "hidden_member"

Defined in: editor/src/inspector/problems.ts:24

column?#

readonly optional column?: number

Defined in: editor/src/inspector/problems.ts:28

line?#

readonly optional line?: number

Defined in: editor/src/inspector/problems.ts:27

message#

readonly message: string

Defined in: editor/src/inspector/problems.ts:25

path#

readonly path: readonly PathSegment[]

Defined in: editor/src/inspector/problems.ts:26

Type Aliases#

Result#

Result<T> = { ok: true; value: T; } | { ok: false; problems: readonly InspectorProblem[]; }

Defined in: editor/src/inspector/problems.ts:32

A value, or every problem that kept it from being read.

Type Parameters#

T#

T

Variables#

InspectorCode#

const InspectorCode: object

Defined in: editor/src/inspector/problems.ts:6

The inspector’s own problem codes, beside those of core’s command refusals.

Type Declaration#

hiddenMember#

readonly hiddenMember: "hidden_member" = "hidden_member"

The text names a member it excludes (graphical while “Include styling” is unchecked).

invalidValue#

readonly invalidValue: "invalid_value" = "invalid_value"

A value without a JSON form, such as a TOML date.

nonFiniteNumber#

readonly nonFiniteNumber: "non_finite_number" = "non_finite_number"

A number that is infinite or not a number.

notRepresentable#

readonly notRepresentable: "not_representable" = "not_representable"

A value the chosen text format cannot show (a null TOML cannot omit).

syntaxError#

readonly syntaxError: "syntax_error" = "syntax_error"

The text is not valid JSON, YAML or TOML; the problem carries a line and column.

Functions#

catching()#

catching<T>(read): Result<T>

Defined in: editor/src/inspector/problems.ts:84

read()’s value, or its thrown ProblemError as a failed result.

Type Parameters#

T#

T

Parameters#

read#

() => T

Returns#

Result<T>


problemPlace()#

problemPlace(problem): { position: string; } | { pointer: string | null; }

Defined in: editor/src/inspector/problems.ts:48

Where a problem lies, as a list of problems shows it: a syntax error’s line and column (line 3, column 7, or line 3), else the JSON pointer of its member, null for the top level.

Parameters#

problem#

Pick<InspectorProblem, "path" | "line" | "column">

Returns#

{ position: string; } | { pointer: string | null; }


problemPointer()#

problemPointer(problem): string

Defined in: editor/src/inspector/problems.ts:37

A problem’s path as a JSON pointer (RFC 6901; "" for the whole text).

Parameters#

problem#

Pick<InspectorProblem, "path">

Returns#

string


refused()#

refused(code, message, path?, position?): object

Defined in: editor/src/inspector/problems.ts:64

The failed result of one problem.

Parameters#

code#

ErrorCode | "syntax_error" | "not_representable" | "hidden_member"

message#

string

path?#

readonly PathSegment[] = []

position?#

{ column: number; line: number; } | null = null

Returns#

object

ok#

readonly ok: false

problems#

readonly problems: readonly InspectorProblem[]