Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/editor/common/viewLayout/linePart.ts
3294 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
export const enum LinePartMetadata {
7
IS_WHITESPACE = 1,
8
PSEUDO_BEFORE = 2,
9
PSEUDO_AFTER = 4,
10
11
IS_WHITESPACE_MASK = 0b001,
12
PSEUDO_BEFORE_MASK = 0b010,
13
PSEUDO_AFTER_MASK = 0b100,
14
}
15
16
export class LinePart {
17
_linePartBrand: void = undefined;
18
19
constructor(
20
/**
21
* last char index of this token (not inclusive).
22
*/
23
public readonly endIndex: number,
24
public readonly type: string,
25
public readonly metadata: number,
26
public readonly containsRTL: boolean
27
) { }
28
29
public isWhitespace(): boolean {
30
return (this.metadata & LinePartMetadata.IS_WHITESPACE_MASK ? true : false);
31
}
32
33
public isPseudoAfter(): boolean {
34
return (this.metadata & LinePartMetadata.PSEUDO_AFTER_MASK ? true : false);
35
}
36
}
37
38