@theia/filesystem 1.72.0-next.36 → 1.72.0-next.45
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/lib/browser/file-tree/file-tree-decorator-adapter.d.ts +0 -1
- package/lib/browser/file-tree/file-tree-decorator-adapter.d.ts.map +1 -1
- package/lib/browser/file-tree/file-tree-decorator-adapter.js +30 -37
- package/lib/browser/file-tree/file-tree-decorator-adapter.js.map +1 -1
- package/package.json +3 -3
- package/src/browser/file-tree/file-tree-decorator-adapter.ts +31 -39
|
@@ -17,7 +17,6 @@ export declare class FileTreeDecoratorAdapter implements TreeDecorator {
|
|
|
17
17
|
decorations(tree: Tree): MaybePromise<Map<string, TreeDecoration.Data>>;
|
|
18
18
|
protected collectDecorations(tree: Tree): Map<string, TreeDecoration.Data>;
|
|
19
19
|
protected mergeDecorations(ownDecoration?: TreeDecoration.Data, bubbledDecoration?: TreeDecoration.Data): TreeDecoration.Data | undefined;
|
|
20
|
-
protected updateDecorations(oldKeys: IterableIterator<string>, newKeys: IterableIterator<string>): void;
|
|
21
20
|
protected toTheiaDecoration(decorations: Decoration[], bubble?: boolean): TreeDecoration.Data;
|
|
22
21
|
protected toTailDecoration(decoration: Decoration, fontData?: TreeDecoration.FontData, bubble?: boolean): TreeDecoration.TailDecoration.AnyConcrete;
|
|
23
22
|
protected propagateDecorationsByUri(child: URI, decorations: Decoration[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-tree-decorator-adapter.d.ts","sourceRoot":"","sources":["../../../src/browser/file-tree/file-tree-decorator-adapter.ts"],"names":[],"mappings":"AAiBA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAO,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,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,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,IAAI;IAoBhF;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM;IAIpE,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS;IAI3D,wBAAwB,IAAI,IAAI;CAGnC"}
|
|
@@ -36,28 +36,42 @@ let FileTreeDecoratorAdapter = class FileTreeDecoratorAdapter {
|
|
|
36
36
|
return this.onDidChangeDecorationsEmitter.event;
|
|
37
37
|
}
|
|
38
38
|
init() {
|
|
39
|
-
this.decorationsService.onDidChangeDecorations(
|
|
40
|
-
this.updateDecorations(this.decorationsByUri.keys(), newDecorations.keys());
|
|
41
|
-
this.fireDidChangeDecorations();
|
|
42
|
-
});
|
|
39
|
+
this.decorationsService.onDidChangeDecorations(() => this.fireDidChangeDecorations());
|
|
43
40
|
}
|
|
44
41
|
decorations(tree) {
|
|
45
42
|
return this.collectDecorations(tree);
|
|
46
43
|
}
|
|
47
44
|
collectDecorations(tree) {
|
|
48
45
|
const decorations = new Map();
|
|
49
|
-
if (tree.root) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
if (!tree.root) {
|
|
47
|
+
return decorations;
|
|
48
|
+
}
|
|
49
|
+
this.decorationsByUri = new Map();
|
|
50
|
+
this.parentDecorations = new Map();
|
|
51
|
+
// Query the decorations service per visible URI so that decorations dropped
|
|
52
|
+
// by event truncation (see plugin-ext maxEventSize) are fetched on demand.
|
|
53
|
+
for (const node of new browser_1.TopDownTreeIterator(tree.root)) {
|
|
54
|
+
const rawUri = this.getUriForNode(node);
|
|
55
|
+
if (!rawUri || this.decorationsByUri.has(rawUri)) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const uri = new uri_1.default(rawUri);
|
|
59
|
+
const fetched = this.decorationsService.getDecoration(uri, false);
|
|
60
|
+
if (fetched.length) {
|
|
61
|
+
this.decorationsByUri.set(rawUri, this.toTheiaDecoration(fetched, false));
|
|
62
|
+
this.propagateDecorationsByUri(uri, fetched);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
for (const node of new browser_1.TopDownTreeIterator(tree.root)) {
|
|
66
|
+
const rawUri = this.getUriForNode(node);
|
|
67
|
+
if (!rawUri) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const ownDecoration = this.decorationsByUri.get(rawUri);
|
|
71
|
+
const bubbledDecoration = this.parentDecorations.get(rawUri);
|
|
72
|
+
const combined = this.mergeDecorations(ownDecoration, bubbledDecoration);
|
|
73
|
+
if (combined) {
|
|
74
|
+
decorations.set(node.id, combined);
|
|
61
75
|
}
|
|
62
76
|
}
|
|
63
77
|
return decorations;
|
|
@@ -77,27 +91,6 @@ let FileTreeDecoratorAdapter = class FileTreeDecoratorAdapter {
|
|
|
77
91
|
};
|
|
78
92
|
}
|
|
79
93
|
}
|
|
80
|
-
updateDecorations(oldKeys, newKeys) {
|
|
81
|
-
this.parentDecorations.clear();
|
|
82
|
-
const newDecorations = new Map();
|
|
83
|
-
const handleUri = (rawUri) => {
|
|
84
|
-
if (!newDecorations.has(rawUri)) {
|
|
85
|
-
const uri = new uri_1.default(rawUri);
|
|
86
|
-
const decorations = this.decorationsService.getDecoration(uri, false);
|
|
87
|
-
if (decorations.length) {
|
|
88
|
-
newDecorations.set(rawUri, this.toTheiaDecoration(decorations, false));
|
|
89
|
-
this.propagateDecorationsByUri(uri, decorations);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
for (const rawUri of oldKeys) {
|
|
94
|
-
handleUri(rawUri);
|
|
95
|
-
}
|
|
96
|
-
for (const rawUri of newKeys) {
|
|
97
|
-
handleUri(rawUri);
|
|
98
|
-
}
|
|
99
|
-
this.decorationsByUri = newDecorations;
|
|
100
|
-
}
|
|
101
94
|
toTheiaDecoration(decorations, bubble) {
|
|
102
95
|
const color = decorations[0].colorId ? `var(${this.colorRegistry.toCssVariableName(decorations[0].colorId)})` : undefined;
|
|
103
96
|
const fontData = color ? { color } : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-tree-decorator-adapter.js","sourceRoot":"","sources":["../../../src/browser/file-tree/file-tree-decorator-adapter.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAiF;AACjF,oDAA6C;AAC7C,mDAA6D;AAC7D,qFAA6F;AAC7F,qDAA6G;AAE7G,2EAAuE;AACvE,2CAA2C;AAGpC,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAA9B;QACM,OAAE,GAAG,4CAA4C,CAAC;QACxC,kBAAa,GAAG,YAAG,CAAC,iBAAiB,CAAC,2BAA2B,CAAC,CAAC;QAInE,kCAA6B,GAAG,IAAI,gBAAO,EAAoD,CAAC;QACzG,qBAAgB,GAAG,IAAI,GAAG,EAA+B,CAAC;QAC1D,sBAAiB,GAAG,IAAI,GAAG,EAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"file-tree-decorator-adapter.js","sourceRoot":"","sources":["../../../src/browser/file-tree/file-tree-decorator-adapter.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAA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,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;IACnF,CAAC;CACJ,CAAA;AA5HY,4DAAwB;AAGc;IAA9C,IAAA,kBAAM,EAAC,wCAAkB,CAAC;;oEAA2D;AAC5C;IAAzC,IAAA,kBAAM,EAAC,8BAAa,CAAC;sCAAmC,8BAAa;+DAAC;AAW7D;IADT,IAAA,yBAAa,GAAE;;;;oDAGf;mCAjBQ,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CA4HpC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/filesystem",
|
|
3
|
-
"version": "1.72.0-next.
|
|
3
|
+
"version": "1.72.0-next.45+c56d9c4b3",
|
|
4
4
|
"description": "Theia - FileSystem Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.72.0-next.
|
|
6
|
+
"@theia/core": "1.72.0-next.45+c56d9c4b3",
|
|
7
7
|
"@types/body-parser": "^1.19.6",
|
|
8
8
|
"@types/multer": "^1.4.13",
|
|
9
9
|
"@types/tar-fs": "^1.16.3",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"nyc": {
|
|
83
83
|
"extends": "../../configs/nyc.json"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "c56d9c4b3e0191e9d812884695ba500b22a75558"
|
|
86
86
|
}
|
|
@@ -40,10 +40,7 @@ export class FileTreeDecoratorAdapter implements TreeDecorator {
|
|
|
40
40
|
|
|
41
41
|
@postConstruct()
|
|
42
42
|
protected init(): void {
|
|
43
|
-
this.decorationsService.onDidChangeDecorations(
|
|
44
|
-
this.updateDecorations(this.decorationsByUri.keys(), newDecorations.keys());
|
|
45
|
-
this.fireDidChangeDecorations();
|
|
46
|
-
});
|
|
43
|
+
this.decorationsService.onDidChangeDecorations(() => this.fireDidChangeDecorations());
|
|
47
44
|
}
|
|
48
45
|
|
|
49
46
|
decorations(tree: Tree): MaybePromise<Map<string, TreeDecoration.Data>> {
|
|
@@ -51,19 +48,36 @@ export class FileTreeDecoratorAdapter implements TreeDecorator {
|
|
|
51
48
|
}
|
|
52
49
|
|
|
53
50
|
protected collectDecorations(tree: Tree): Map<string, TreeDecoration.Data> {
|
|
54
|
-
const decorations = new Map();
|
|
55
|
-
if (tree.root) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
51
|
+
const decorations = new Map<string, TreeDecoration.Data>();
|
|
52
|
+
if (!tree.root) {
|
|
53
|
+
return decorations;
|
|
54
|
+
}
|
|
55
|
+
this.decorationsByUri = new Map<string, TreeDecoration.Data>();
|
|
56
|
+
this.parentDecorations = new Map<string, TreeDecoration.Data>();
|
|
57
|
+
// Query the decorations service per visible URI so that decorations dropped
|
|
58
|
+
// by event truncation (see plugin-ext maxEventSize) are fetched on demand.
|
|
59
|
+
for (const node of new TopDownTreeIterator(tree.root)) {
|
|
60
|
+
const rawUri = this.getUriForNode(node);
|
|
61
|
+
if (!rawUri || this.decorationsByUri.has(rawUri)) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
const uri = new URI(rawUri);
|
|
65
|
+
const fetched = this.decorationsService.getDecoration(uri, false);
|
|
66
|
+
if (fetched.length) {
|
|
67
|
+
this.decorationsByUri.set(rawUri, this.toTheiaDecoration(fetched, false));
|
|
68
|
+
this.propagateDecorationsByUri(uri, fetched);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
for (const node of new TopDownTreeIterator(tree.root)) {
|
|
72
|
+
const rawUri = this.getUriForNode(node);
|
|
73
|
+
if (!rawUri) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
const ownDecoration = this.decorationsByUri.get(rawUri);
|
|
77
|
+
const bubbledDecoration = this.parentDecorations.get(rawUri);
|
|
78
|
+
const combined = this.mergeDecorations(ownDecoration, bubbledDecoration);
|
|
79
|
+
if (combined) {
|
|
80
|
+
decorations.set(node.id, combined);
|
|
67
81
|
}
|
|
68
82
|
}
|
|
69
83
|
return decorations;
|
|
@@ -83,28 +97,6 @@ export class FileTreeDecoratorAdapter implements TreeDecorator {
|
|
|
83
97
|
}
|
|
84
98
|
}
|
|
85
99
|
|
|
86
|
-
protected updateDecorations(oldKeys: IterableIterator<string>, newKeys: IterableIterator<string>): void {
|
|
87
|
-
this.parentDecorations.clear();
|
|
88
|
-
const newDecorations = new Map<string, TreeDecoration.Data>();
|
|
89
|
-
const handleUri = (rawUri: string) => {
|
|
90
|
-
if (!newDecorations.has(rawUri)) {
|
|
91
|
-
const uri = new URI(rawUri);
|
|
92
|
-
const decorations = this.decorationsService.getDecoration(uri, false);
|
|
93
|
-
if (decorations.length) {
|
|
94
|
-
newDecorations.set(rawUri, this.toTheiaDecoration(decorations, false));
|
|
95
|
-
this.propagateDecorationsByUri(uri, decorations);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
for (const rawUri of oldKeys) {
|
|
100
|
-
handleUri(rawUri);
|
|
101
|
-
}
|
|
102
|
-
for (const rawUri of newKeys) {
|
|
103
|
-
handleUri(rawUri);
|
|
104
|
-
}
|
|
105
|
-
this.decorationsByUri = newDecorations;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
100
|
protected toTheiaDecoration(decorations: Decoration[], bubble?: boolean): TreeDecoration.Data {
|
|
109
101
|
const color = decorations[0].colorId ? `var(${this.colorRegistry.toCssVariableName(decorations[0].colorId)})` : undefined;
|
|
110
102
|
const fontData = color ? { color } : undefined;
|