@noldova/code.editor.angular 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +12 -2
- package/api/index.d.ts +30 -0
- package/api/index.js +27 -0
- package/app/components/code-editor/code-editor.component.d.ts +332 -0
- package/app/components/code-editor/code-editor.component.js +648 -0
- package/app/components/code-text/code-text.component.d.ts +70 -0
- package/app/components/code-text/code-text.component.js +40 -0
- package/app/components/find-bar/find-bar.component.d.ts +40 -0
- package/app/components/find-bar/find-bar.component.js +95 -0
- package/app/enums/code-row-kind.d.ts +14 -0
- package/app/enums/code-row-kind.js +15 -0
- package/app/enums/fold-shortcut.d.ts +11 -0
- package/app/enums/fold-shortcut.js +12 -0
- package/app/exceptions/background-job-failed.exception.d.ts +33 -0
- package/app/exceptions/background-job-failed.exception.js +15 -0
- package/app/interfaces/i-code-decorations.d.ts +103 -0
- package/app/interfaces/i-code-decorations.js +7 -0
- package/app/interfaces/i-code-editor-view.d.ts +13 -0
- package/app/interfaces/i-code-editor-view.js +7 -0
- package/app/interfaces/i-code-numbering.d.ts +38 -0
- package/app/interfaces/i-code-numbering.js +7 -0
- package/app/models/code-editor-view.d.ts +18 -0
- package/app/models/code-editor-view.js +26 -0
- package/app/models/code-search.d.ts +18 -0
- package/app/models/code-search.js +52 -0
- package/app/models/code-text-line.d.ts +17 -0
- package/app/models/code-text-line.js +42 -0
- package/app/models/code-text-span.d.ts +15 -0
- package/app/models/code-text-span.js +19 -0
- package/app/models/decorations/code-bar-action-event.d.ts +39 -0
- package/app/models/decorations/code-bar-action-event.js +15 -0
- package/app/models/decorations/code-bar-action.d.ts +40 -0
- package/app/models/decorations/code-bar-action.js +17 -0
- package/app/models/decorations/code-bar.d.ts +78 -0
- package/app/models/decorations/code-bar.js +34 -0
- package/app/models/decorations/code-decorations.d.ts +121 -0
- package/app/models/decorations/code-decorations.js +42 -0
- package/app/models/decorations/code-gutter-marker.d.ts +46 -0
- package/app/models/decorations/code-gutter-marker.js +20 -0
- package/app/models/decorations/code-line-decoration.d.ts +48 -0
- package/app/models/decorations/code-line-decoration.js +21 -0
- package/app/models/decorations/code-range-decoration.d.ts +44 -0
- package/app/models/decorations/code-range-decoration.js +15 -0
- package/app/models/folding/code-block.d.ts +17 -0
- package/app/models/folding/code-block.js +21 -0
- package/app/models/folding/code-blocks.d.ts +17 -0
- package/app/models/folding/code-blocks.js +32 -0
- package/app/models/folding/code-fold.d.ts +53 -0
- package/app/models/folding/code-fold.js +23 -0
- package/app/models/folding/fold-shortcuts.d.ts +14 -0
- package/app/models/folding/fold-shortcuts.js +17 -0
- package/app/models/language-tokenizer.d.ts +39 -0
- package/app/models/language-tokenizer.js +22 -0
- package/app/models/rows/code-embedded-lines.d.ts +76 -0
- package/app/models/rows/code-embedded-lines.js +43 -0
- package/app/models/rows/code-inserted-rows.d.ts +19 -0
- package/app/models/rows/code-inserted-rows.js +7 -0
- package/app/models/rows/code-row.d.ts +27 -0
- package/app/models/rows/code-row.js +31 -0
- package/app/models/rows/code-spacer.d.ts +61 -0
- package/app/models/rows/code-spacer.js +30 -0
- package/app/models/rows/inserted-rows.d.ts +12 -0
- package/app/models/rows/inserted-rows.js +18 -0
- package/app/models/rows/layer-lines.d.ts +18 -0
- package/app/models/rows/layer-lines.js +17 -0
- package/app/models/rows/layout-row.d.ts +14 -0
- package/app/models/rows/layout-row.js +17 -0
- package/app/models/rows/line-index.d.ts +58 -0
- package/app/models/rows/line-index.js +50 -0
- package/app/models/rows/row-builder.d.ts +35 -0
- package/app/models/rows/row-builder.js +87 -0
- package/app/models/rows/row-layout.d.ts +22 -0
- package/app/models/rows/row-layout.js +58 -0
- package/app/models/rows/row-span.d.ts +13 -0
- package/app/models/rows/row-span.js +17 -0
- package/app/models/shapes/bar-shape.d.ts +13 -0
- package/app/models/shapes/bar-shape.js +15 -0
- package/app/models/shapes/change-shape.d.ts +14 -0
- package/app/models/shapes/change-shape.js +19 -0
- package/app/models/shapes/code-shape.d.ts +14 -0
- package/app/models/shapes/code-shape.js +19 -0
- package/app/models/shapes/match-shape.d.ts +14 -0
- package/app/models/shapes/match-shape.js +19 -0
- package/app/models/text-measure.d.ts +18 -0
- package/app/models/text-measure.js +50 -0
- package/app/models/view-command.d.ts +16 -0
- package/app/models/view-command.js +24 -0
- package/app/services/background-ticker.d.ts +47 -0
- package/app/services/background-ticker.js +34 -0
- package/app/services/code-editor-classes.d.ts +102 -0
- package/app/services/code-editor-classes.js +30 -0
- package/app/services/code-editor-contribution.d.ts +20 -0
- package/app/services/code-editor-contribution.js +41 -0
- package/app/services/code-editor-features.d.ts +13 -0
- package/app/services/code-editor-features.js +13 -0
- package/app/services/code-editor-registries.d.ts +43 -0
- package/app/services/code-editor-registries.js +23 -0
- package/app/services/key-scope.d.ts +79 -0
- package/app/services/key-scope.js +53 -0
- package/app/services/token-style-sheet.d.ts +11 -0
- package/app/services/token-style-sheet.js +44 -0
- package/app/services/worker-runner.d.ts +87 -0
- package/app/services/worker-runner.js +84 -0
- package/package.json +38 -4
- package/resources.d.ts +124 -0
- package/resources.js +137 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) Noldova.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
import { HashSet } from "@noldova/context.collections";
|
|
9
|
+
import { SlicedRunner, WorkerJobAnswer } from "@noldova/code.editor";
|
|
10
|
+
import { CancellationToken, OperationCanceledException } from "@noldova/context.threading";
|
|
11
|
+
import { Resources } from "../../resources.js";
|
|
12
|
+
import { BackgroundJobFailedException } from "../exceptions/background-job-failed.exception.js";
|
|
13
|
+
export class WorkerRunner {
|
|
14
|
+
fallback;
|
|
15
|
+
worker;
|
|
16
|
+
breaks = new HashSet();
|
|
17
|
+
nextId = 0;
|
|
18
|
+
broken = false;
|
|
19
|
+
disposed = false;
|
|
20
|
+
constructor(worker, fallback = new SlicedRunner()) {
|
|
21
|
+
this.worker = worker;
|
|
22
|
+
this.fallback = fallback;
|
|
23
|
+
worker.addEventListener(Resources.error, (event) => {
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
this.broken = true;
|
|
26
|
+
this.stopAll();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
get usesWorker() {
|
|
30
|
+
return !this.broken && !this.disposed;
|
|
31
|
+
}
|
|
32
|
+
async runAsync(job, input, cancellationToken = CancellationToken.none) {
|
|
33
|
+
cancellationToken.throwIfCancellationRequested();
|
|
34
|
+
if (this.disposed)
|
|
35
|
+
throw new BackgroundJobFailedException(job.name, Resources.runnerDisposed);
|
|
36
|
+
if (this.broken)
|
|
37
|
+
return await this.fallback.runAsync(job, input, cancellationToken);
|
|
38
|
+
const id = this.nextId++;
|
|
39
|
+
const call = Promise.withResolvers();
|
|
40
|
+
const finish = () => {
|
|
41
|
+
this.worker.removeEventListener(Resources.message, onMessage);
|
|
42
|
+
registration.unregister();
|
|
43
|
+
this.breaks.remove(onBreak);
|
|
44
|
+
};
|
|
45
|
+
const onMessage = (event) => {
|
|
46
|
+
const response = event.data;
|
|
47
|
+
if (response.id !== id)
|
|
48
|
+
return;
|
|
49
|
+
finish();
|
|
50
|
+
if (response.answer === WorkerJobAnswer.Output)
|
|
51
|
+
call.resolve(response.output);
|
|
52
|
+
else if (response.answer === WorkerJobAnswer.Missing)
|
|
53
|
+
call.resolve(this.fallback.runAsync(job, input, cancellationToken));
|
|
54
|
+
else
|
|
55
|
+
call.reject(new BackgroundJobFailedException(job.name, response.reason));
|
|
56
|
+
};
|
|
57
|
+
const onCancel = () => {
|
|
58
|
+
finish();
|
|
59
|
+
call.reject(new OperationCanceledException(undefined, cancellationToken));
|
|
60
|
+
};
|
|
61
|
+
const onBreak = () => {
|
|
62
|
+
finish();
|
|
63
|
+
if (this.disposed)
|
|
64
|
+
call.reject(new BackgroundJobFailedException(job.name, Resources.runnerDisposed));
|
|
65
|
+
else
|
|
66
|
+
call.resolve(this.fallback.runAsync(job, input, cancellationToken));
|
|
67
|
+
};
|
|
68
|
+
this.worker.addEventListener(Resources.message, onMessage);
|
|
69
|
+
const registration = cancellationToken.register(onCancel);
|
|
70
|
+
this.breaks.add(onBreak);
|
|
71
|
+
const request = { id, name: job.name, input };
|
|
72
|
+
this.worker.postMessage(request);
|
|
73
|
+
return await call.promise;
|
|
74
|
+
}
|
|
75
|
+
[Symbol.dispose]() {
|
|
76
|
+
this.disposed = true;
|
|
77
|
+
this.worker.terminate();
|
|
78
|
+
this.stopAll();
|
|
79
|
+
}
|
|
80
|
+
stopAll() {
|
|
81
|
+
for (const stop of this.breaks.toArray())
|
|
82
|
+
stop();
|
|
83
|
+
}
|
|
84
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noldova/code.editor.angular",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "The code editor's views in Angular: the code view with its decorations, folds and inserted rows, the find bar and the diff view, styled only with the kit's tokens.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "api/index.js",
|
|
7
|
+
"types": "api/index.d.ts",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/noldova-com/code-editor.git",
|
|
12
|
+
"directory": "src/noldova.code.editor.angular"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/noldova-com/code-editor#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/noldova-com/code-editor/issues"
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public",
|
|
20
|
+
"registry": "https://registry.npmjs.org/"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "ngc -p tsconfig.json && playwright install --only-shell chromium && ng test"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@noldova/code.editor": "0.0.1",
|
|
27
|
+
"tslib": "2.8.1"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@angular/common": ">=22.3.0 <23.0.0",
|
|
31
|
+
"@angular/core": ">=22.3.0 <23.0.0",
|
|
32
|
+
"@noldova/context.collections": ">=0.0.16 <0.1.0",
|
|
33
|
+
"@noldova/context.core": ">=0.0.16 <0.1.0",
|
|
34
|
+
"@noldova/context.exceptions": ">=0.0.16 <0.1.0",
|
|
35
|
+
"@noldova/context.threading": ">=0.0.16 <0.1.0",
|
|
36
|
+
"@noldova/ui.components.angular": ">=0.0.35 <0.1.0",
|
|
37
|
+
"rxjs": ">=7.8.2 <8.0.0"
|
|
38
|
+
},
|
|
39
|
+
"gitHead": "f8f8640dfb1de8dc2db7e4f446dccd90facc25dd"
|
|
40
|
+
}
|
package/resources.d.ts
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) Noldova.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
import "@noldova/context.core";
|
|
9
|
+
import { type LineSegment, type TokenTypeRegistry } from "@noldova/code.editor";
|
|
10
|
+
import type { IReadOnlyList } from "@noldova/context.collections";
|
|
11
|
+
import type { CodeRowKind } from "./app/enums/code-row-kind.js";
|
|
12
|
+
export declare class Resources {
|
|
13
|
+
static readonly empty: string;
|
|
14
|
+
static readonly space: string;
|
|
15
|
+
static readonly tab: string;
|
|
16
|
+
static readonly lineFeed: string;
|
|
17
|
+
static readonly viewFeature: string;
|
|
18
|
+
static readonly viewContribution: string;
|
|
19
|
+
static readonly findVisibleDescription: string;
|
|
20
|
+
static readonly canvasContext: "2d";
|
|
21
|
+
static readonly plainText: string;
|
|
22
|
+
static readonly files: string;
|
|
23
|
+
static readonly copyEffect: "copy";
|
|
24
|
+
static readonly noEffect: "none";
|
|
25
|
+
static readonly mouseMove: "mousemove";
|
|
26
|
+
static readonly mouseUp: "mouseup";
|
|
27
|
+
static readonly message: "message";
|
|
28
|
+
static readonly error: "error";
|
|
29
|
+
static readonly runnerDisposed: string;
|
|
30
|
+
static readonly finalPeriodPattern: RegExp;
|
|
31
|
+
static readonly inputInsertText: string;
|
|
32
|
+
static readonly inputInsertReplacementText: string;
|
|
33
|
+
static readonly inputInsertLineBreak: string;
|
|
34
|
+
static readonly inputInsertParagraph: string;
|
|
35
|
+
static readonly inputContextLines: number;
|
|
36
|
+
static readonly forward: "forward";
|
|
37
|
+
static readonly backward: "backward";
|
|
38
|
+
static readonly marginLines: number;
|
|
39
|
+
static readonly backgroundSliceMilliseconds: number;
|
|
40
|
+
static readonly statusSliceMilliseconds: number;
|
|
41
|
+
static readonly plainSegmentClass: string;
|
|
42
|
+
static readonly tokenClassPrefix: string;
|
|
43
|
+
static readonly textTokenClassPrefix: string;
|
|
44
|
+
static readonly tokenStyleAttribute: string;
|
|
45
|
+
static readonly rowClassPrefix: string;
|
|
46
|
+
static readonly foldOpenIcon: string;
|
|
47
|
+
static readonly foldClosedIcon: string;
|
|
48
|
+
static readonly inherit: string;
|
|
49
|
+
static readonly manyLines: string;
|
|
50
|
+
static readonly unchangedWord: string;
|
|
51
|
+
static readonly keyEnter: string;
|
|
52
|
+
static readonly keyEscape: string;
|
|
53
|
+
static readonly findLabel: string;
|
|
54
|
+
static readonly replaceLabel: string;
|
|
55
|
+
static readonly matchCaseLabel: string;
|
|
56
|
+
static readonly wholeWordLabel: string;
|
|
57
|
+
static readonly regexLabel: string;
|
|
58
|
+
static readonly previousMatchLabel: string;
|
|
59
|
+
static readonly nextMatchLabel: string;
|
|
60
|
+
static readonly closeLabel: string;
|
|
61
|
+
static readonly replaceOneLabel: string;
|
|
62
|
+
static readonly replaceAllLabel: string;
|
|
63
|
+
static readonly noResults: string;
|
|
64
|
+
static readonly invalidPattern: string;
|
|
65
|
+
static readonly unknownPosition: string;
|
|
66
|
+
static readonly ofWord: string;
|
|
67
|
+
static readonly moreMatches: string;
|
|
68
|
+
static readonly beforeLineParameter: string;
|
|
69
|
+
static readonly rowCountParameter: string;
|
|
70
|
+
static readonly startLineParameter: string;
|
|
71
|
+
static readonly lineCountParameter: string;
|
|
72
|
+
static readonly lineParameter: string;
|
|
73
|
+
static readonly styleElement: "style";
|
|
74
|
+
static readonly findKeys: string;
|
|
75
|
+
static readonly findAlternateKeys: string;
|
|
76
|
+
static readonly replaceMacKeys: string;
|
|
77
|
+
static readonly replaceKeys: string;
|
|
78
|
+
static readonly closeFindKeys: string;
|
|
79
|
+
static readonly foldKeys: string;
|
|
80
|
+
static readonly foldMacKeys: string;
|
|
81
|
+
static readonly unfoldKeys: string;
|
|
82
|
+
static readonly unfoldMacKeys: string;
|
|
83
|
+
static readonly lineClass: string;
|
|
84
|
+
static readonly changeClass: string;
|
|
85
|
+
static readonly lineNumberClass: string;
|
|
86
|
+
static readonly paintClass: string;
|
|
87
|
+
static readonly codeRowClass: string;
|
|
88
|
+
static readonly rowSpacerClass: string;
|
|
89
|
+
static readonly rowFoldClass: string;
|
|
90
|
+
static readonly lineFoldClass: string;
|
|
91
|
+
static readonly foldToggleClass: string;
|
|
92
|
+
static readonly foldIconClass: string;
|
|
93
|
+
static readonly scrollerClass: string;
|
|
94
|
+
static readonly inputClass: string;
|
|
95
|
+
static readonly caretClass: string;
|
|
96
|
+
static readonly matchClass: string;
|
|
97
|
+
static readonly signClass: string;
|
|
98
|
+
static readonly numberClass: string;
|
|
99
|
+
static readonly findFieldClass: string;
|
|
100
|
+
static readonly codeEditorClass: string;
|
|
101
|
+
static readonly focusedClass: string;
|
|
102
|
+
static readonly focusedClassBinding: string;
|
|
103
|
+
static readonly codeTextClass: string;
|
|
104
|
+
static readonly findBarClass: string;
|
|
105
|
+
static readonly findCommand: string;
|
|
106
|
+
static readonly replaceCommand: string;
|
|
107
|
+
static readonly closeFindCommand: string;
|
|
108
|
+
static readonly foldCommand: string;
|
|
109
|
+
static readonly unfoldCommand: string;
|
|
110
|
+
static readonly findVisibleKey: string;
|
|
111
|
+
static readonly backgroundJobFailedExceptionName: string;
|
|
112
|
+
static readonly decimalRadix: number;
|
|
113
|
+
static readonly period: string;
|
|
114
|
+
static readonly backgroundJobPhrase: string;
|
|
115
|
+
static readonly failedInWorkerPhrase: string;
|
|
116
|
+
static readonly pastDocumentPhrase: string;
|
|
117
|
+
static segmentClass(registry: TokenTypeRegistry, segment: LineSegment): string;
|
|
118
|
+
static formatClassList(classes: IReadOnlyList<string>): string;
|
|
119
|
+
static rowClass(kind: CodeRowKind): string;
|
|
120
|
+
static formatMatches(position: number, count: number, complete: boolean): string;
|
|
121
|
+
static formatBackgroundJobFailed(job: string, reason: string): string;
|
|
122
|
+
static formatPastDocument(lineCount: number): string;
|
|
123
|
+
static formatHidden(count: number): string;
|
|
124
|
+
}
|
package/resources.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) Noldova.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
import "@noldova/context.core";
|
|
9
|
+
import { TokenStyles } from "@noldova/code.editor";
|
|
10
|
+
export class Resources {
|
|
11
|
+
static empty = "";
|
|
12
|
+
static space = " ";
|
|
13
|
+
static tab = "\t";
|
|
14
|
+
static lineFeed = "\n";
|
|
15
|
+
static viewFeature = "view";
|
|
16
|
+
static viewContribution = "noldova.code.editor.angular";
|
|
17
|
+
static findVisibleDescription = "The find panel is open.";
|
|
18
|
+
static canvasContext = "2d";
|
|
19
|
+
static plainText = "text/plain";
|
|
20
|
+
static files = "Files";
|
|
21
|
+
static copyEffect = "copy";
|
|
22
|
+
static noEffect = "none";
|
|
23
|
+
static mouseMove = "mousemove";
|
|
24
|
+
static mouseUp = "mouseup";
|
|
25
|
+
static message = "message";
|
|
26
|
+
static error = "error";
|
|
27
|
+
static runnerDisposed = "the runner was disposed";
|
|
28
|
+
static finalPeriodPattern = /\.$/u;
|
|
29
|
+
static inputInsertText = "insertText";
|
|
30
|
+
static inputInsertReplacementText = "insertReplacementText";
|
|
31
|
+
static inputInsertLineBreak = "insertLineBreak";
|
|
32
|
+
static inputInsertParagraph = "insertParagraph";
|
|
33
|
+
static inputContextLines = 3;
|
|
34
|
+
static forward = "forward";
|
|
35
|
+
static backward = "backward";
|
|
36
|
+
static marginLines = 10;
|
|
37
|
+
static backgroundSliceMilliseconds = 5;
|
|
38
|
+
static statusSliceMilliseconds = 2;
|
|
39
|
+
static plainSegmentClass = "nol-code-editor-plain";
|
|
40
|
+
static tokenClassPrefix = "nol-code-editor-token-";
|
|
41
|
+
static textTokenClassPrefix = "nol-code-text-token-";
|
|
42
|
+
static tokenStyleAttribute = "data-nol-code-tokens";
|
|
43
|
+
static rowClassPrefix = "nol-code-editor-row-";
|
|
44
|
+
static foldOpenIcon = "expand_more";
|
|
45
|
+
static foldClosedIcon = "chevron_right";
|
|
46
|
+
static inherit = "inherit";
|
|
47
|
+
static manyLines = "lines";
|
|
48
|
+
static unchangedWord = "unchanged";
|
|
49
|
+
static keyEnter = "Enter";
|
|
50
|
+
static keyEscape = "Escape";
|
|
51
|
+
static findLabel = "Find";
|
|
52
|
+
static replaceLabel = "Replace";
|
|
53
|
+
static matchCaseLabel = "Match case";
|
|
54
|
+
static wholeWordLabel = "Match whole word";
|
|
55
|
+
static regexLabel = "Use regular expression";
|
|
56
|
+
static previousMatchLabel = "Previous match";
|
|
57
|
+
static nextMatchLabel = "Next match";
|
|
58
|
+
static closeLabel = "Close";
|
|
59
|
+
static replaceOneLabel = "Replace";
|
|
60
|
+
static replaceAllLabel = "Replace all";
|
|
61
|
+
static noResults = "No results";
|
|
62
|
+
static invalidPattern = "Invalid pattern";
|
|
63
|
+
static unknownPosition = "?";
|
|
64
|
+
static ofWord = "of";
|
|
65
|
+
static moreMatches = "+";
|
|
66
|
+
static beforeLineParameter = "beforeLine";
|
|
67
|
+
static rowCountParameter = "rowCount";
|
|
68
|
+
static startLineParameter = "startLine";
|
|
69
|
+
static lineCountParameter = "lineCount";
|
|
70
|
+
static lineParameter = "line";
|
|
71
|
+
static styleElement = "style";
|
|
72
|
+
static findKeys = "mod+f";
|
|
73
|
+
static findAlternateKeys = "mod+shift+f";
|
|
74
|
+
static replaceMacKeys = "cmd+alt+f";
|
|
75
|
+
static replaceKeys = "ctrl+h";
|
|
76
|
+
static closeFindKeys = "escape";
|
|
77
|
+
static foldKeys = "ctrl+shift+BracketLeft";
|
|
78
|
+
static foldMacKeys = "cmd+alt+BracketLeft";
|
|
79
|
+
static unfoldKeys = "ctrl+shift+BracketRight";
|
|
80
|
+
static unfoldMacKeys = "cmd+alt+BracketRight";
|
|
81
|
+
static lineClass = "nol-code-editor-line";
|
|
82
|
+
static changeClass = "nol-code-editor-change";
|
|
83
|
+
static lineNumberClass = "nol-code-editor-line-number";
|
|
84
|
+
static paintClass = "nol-code-editor-paint";
|
|
85
|
+
static codeRowClass = "nol-code-editor-row";
|
|
86
|
+
static rowSpacerClass = "nol-code-editor-row-spacer";
|
|
87
|
+
static rowFoldClass = "nol-code-editor-row-fold";
|
|
88
|
+
static lineFoldClass = "nol-code-editor-line-fold";
|
|
89
|
+
static foldToggleClass = "nol-code-editor-fold-toggle";
|
|
90
|
+
static foldIconClass = "nol-code-editor-fold-icon";
|
|
91
|
+
static scrollerClass = "nol-code-editor-scroller";
|
|
92
|
+
static inputClass = "nol-code-editor-input";
|
|
93
|
+
static caretClass = "nol-code-editor-caret";
|
|
94
|
+
static matchClass = "nol-code-editor-match";
|
|
95
|
+
static signClass = "nol-code-editor-sign";
|
|
96
|
+
static numberClass = "nol-code-editor-number";
|
|
97
|
+
static findFieldClass = "nol-find-bar-field";
|
|
98
|
+
static codeEditorClass = "nol-code-editor";
|
|
99
|
+
static focusedClass = "nol-code-editor-focused";
|
|
100
|
+
static focusedClassBinding = `[class.${Resources.focusedClass}]`;
|
|
101
|
+
static codeTextClass = "nol-code-text";
|
|
102
|
+
static findBarClass = "nol-find-bar";
|
|
103
|
+
static findCommand = "editor.action.find";
|
|
104
|
+
static replaceCommand = "editor.action.replace";
|
|
105
|
+
static closeFindCommand = "editor.action.closeFind";
|
|
106
|
+
static foldCommand = "editor.fold";
|
|
107
|
+
static unfoldCommand = "editor.unfold";
|
|
108
|
+
static findVisibleKey = "findVisible";
|
|
109
|
+
static backgroundJobFailedExceptionName = "BackgroundJobFailedException";
|
|
110
|
+
static decimalRadix = 10;
|
|
111
|
+
static period = ".";
|
|
112
|
+
static backgroundJobPhrase = "The background job";
|
|
113
|
+
static failedInWorkerPhrase = "failed in the worker:";
|
|
114
|
+
static pastDocumentPhrase = "The lines must end within the document's";
|
|
115
|
+
static segmentClass(registry, segment) {
|
|
116
|
+
const classes = TokenStyles.classesOf(registry, segment.type, segment.modifiers, Resources.tokenClassPrefix);
|
|
117
|
+
return classes.any() ? Resources.formatClassList(classes) : Resources.plainSegmentClass;
|
|
118
|
+
}
|
|
119
|
+
static formatClassList(classes) {
|
|
120
|
+
return classes.aggregate(Resources.empty, (total, t) => total === Resources.empty ? t : `${total}${Resources.space}${t}`);
|
|
121
|
+
}
|
|
122
|
+
static rowClass(kind) {
|
|
123
|
+
return `${Resources.rowClassPrefix}${kind.toLowerCase()}`;
|
|
124
|
+
}
|
|
125
|
+
static formatMatches(position, count, complete) {
|
|
126
|
+
return `${position === 0 ? Resources.unknownPosition : position} ${Resources.ofWord} ${count}${complete ? Resources.empty : Resources.moreMatches}`;
|
|
127
|
+
}
|
|
128
|
+
static formatBackgroundJobFailed(job, reason) {
|
|
129
|
+
return `${Resources.backgroundJobPhrase} ${job} ${Resources.failedInWorkerPhrase} ${reason.replace(Resources.finalPeriodPattern, Resources.empty)}${Resources.period}`;
|
|
130
|
+
}
|
|
131
|
+
static formatPastDocument(lineCount) {
|
|
132
|
+
return `${Resources.pastDocumentPhrase} ${lineCount} ${Resources.manyLines}${Resources.period}`;
|
|
133
|
+
}
|
|
134
|
+
static formatHidden(count) {
|
|
135
|
+
return `${count} ${Resources.unchangedWord} ${Resources.manyLines}`;
|
|
136
|
+
}
|
|
137
|
+
}
|