Skip to main content

Module: libs/vscode-common/testUtil/toPlainObject

Type aliases

PositionPlainObject

Ƭ PositionPlainObject: Object

Type declaration

NameType
characternumber
linenumber

Defined in

libs/vscode-common/testUtil/toPlainObject.ts:6


RangePlainObject

Ƭ RangePlainObject: Object

Type declaration

NameType
endPositionPlainObject
startPositionPlainObject

Defined in

libs/vscode-common/testUtil/toPlainObject.ts:11


SelectionPlainObject

Ƭ SelectionPlainObject: Object

Type declaration

NameType
activePositionPlainObject
anchorPositionPlainObject

Defined in

libs/vscode-common/testUtil/toPlainObject.ts:16


SerializedMarks

Ƭ SerializedMarks: Object

Index signature

[decoratedCharacter: string]: RangePlainObject

Defined in

libs/vscode-common/testUtil/toPlainObject.ts:52


TargetPlainObject

Ƭ TargetPlainObject: Object

Type for a plain object representing a Target, to be used for serialization via json. Note that this definition is still quite incomplete, as it is missing a lot of attributes, so today can only properly round-trip an UntypedTarget, but for other types it at least captures the fact that they are not UntypedTargets, so we can use to check that actions return rich targets, even if we don't check everything about the target, and we can't use it to construct rich targets as inputs to actions in tests.

Type declaration

NameTypeDescription
contentRangeRangePlainObjectCorresponds to Target.contentRange
hasExplicitRangebooleanCorresponds to Target.hasExplicitRange.
isReversedbooleanCorresponds to Target.isReversed.
typestringThe type name of the target, eg UntypedTarget.

Defined in

libs/vscode-common/testUtil/toPlainObject.ts:30

Functions

marksToPlainObject

marksToPlainObject(marks): SerializedMarks

Parameters

NameType
marksObject

Returns

SerializedMarks

Defined in

libs/vscode-common/testUtil/toPlainObject.ts:98


positionToPlainObject

positionToPlainObject(__namedParameters): PositionPlainObject

Parameters

NameType
__namedParametersPosition

Returns

PositionPlainObject

Defined in

libs/vscode-common/testUtil/toPlainObject.ts:91


rangeToPlainObject

rangeToPlainObject(range): RangePlainObject

Parameters

NameType
rangeRange

Returns

RangePlainObject

Defined in

libs/vscode-common/testUtil/toPlainObject.ts:56


selectionToPlainObject

selectionToPlainObject(selection): SelectionPlainObject

Parameters

NameType
selectionSelection

Returns

SelectionPlainObject

Defined in

libs/vscode-common/testUtil/toPlainObject.ts:63


targetToPlainObject

targetToPlainObject(target): TargetPlainObject

Given a target, constructs an object suitable for serialization by json. Note that this implementation is quite incomplete, but is suitable for round-tripping UntypedTarget objects and capturing the fact that an object is not an un typed target if it is not, via the type attribute.

Parameters

NameTypeDescription
targetTargetThe target to convert to a plain object

Returns

TargetPlainObject

A plain object that can be json serialized

Defined in

libs/vscode-common/testUtil/toPlainObject.ts:82


testDecorationsToPlainObject

testDecorationsToPlainObject(decorations): { end: PositionPlainObject ; name: "pendingDeleteBackground" | "referencedBackground" | "pendingModification0Background" | "pendingModification1Background" | "justAddedBackground" | "highlight0Background" | "highlight1Background" ; start: PositionPlainObject ; type: "token" | "line" }[]

Parameters

NameType
decorationsTestDecoration[]

Returns

{ end: PositionPlainObject ; name: "pendingDeleteBackground" | "referencedBackground" | "pendingModification0Background" | "pendingModification1Background" | "justAddedBackground" | "highlight0Background" | "highlight1Background" ; start: PositionPlainObject ; type: "token" | "line" }[]

Defined in

libs/vscode-common/testUtil/toPlainObject.ts:109