@theia/filesystem 1.72.0-next.46 → 1.72.0-next.50
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 +1 -0
- package/lib/browser/file-tree/file-tree-decorator-adapter.d.ts.map +1 -1
- package/lib/browser/file-tree/file-tree-decorator-adapter.js +37 -30
- 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 +39 -31
|
@@ -17,6 +17,7 @@ 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;
|
|
20
21
|
protected toTheiaDecoration(decorations: Decoration[], bubble?: boolean): TreeDecoration.Data;
|
|
21
22
|
protected toTailDecoration(decoration: Decoration, fontData?: TreeDecoration.FontData, bubble?: boolean): TreeDecoration.TailDecoration.AnyConcrete;
|
|
22
23
|
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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CAAC,EAAE,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC,cAAc,CAAC,WAAW;IAOnJ,SAAS,CAAC,yBAAyB,CAAC,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,42 +36,28 @@ let FileTreeDecoratorAdapter = class FileTreeDecoratorAdapter {
|
|
|
36
36
|
return this.onDidChangeDecorationsEmitter.event;
|
|
37
37
|
}
|
|
38
38
|
init() {
|
|
39
|
-
this.decorationsService.onDidChangeDecorations(
|
|
39
|
+
this.decorationsService.onDidChangeDecorations(newDecorations => {
|
|
40
|
+
this.updateDecorations(this.decorationsByUri.keys(), newDecorations.keys());
|
|
41
|
+
this.fireDidChangeDecorations();
|
|
42
|
+
});
|
|
40
43
|
}
|
|
41
44
|
decorations(tree) {
|
|
42
45
|
return this.collectDecorations(tree);
|
|
43
46
|
}
|
|
44
47
|
collectDecorations(tree) {
|
|
45
48
|
const decorations = new Map();
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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);
|
|
49
|
+
if (tree.root) {
|
|
50
|
+
for (const node of new browser_1.TopDownTreeIterator(tree.root)) {
|
|
51
|
+
const uri = this.getUriForNode(node);
|
|
52
|
+
if (uri) {
|
|
53
|
+
const stringified = uri.toString();
|
|
54
|
+
const ownDecoration = this.decorationsByUri.get(stringified);
|
|
55
|
+
const bubbledDecoration = this.parentDecorations.get(stringified);
|
|
56
|
+
const combined = this.mergeDecorations(ownDecoration, bubbledDecoration);
|
|
57
|
+
if (combined) {
|
|
58
|
+
decorations.set(node.id, combined);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
75
61
|
}
|
|
76
62
|
}
|
|
77
63
|
return decorations;
|
|
@@ -91,6 +77,27 @@ let FileTreeDecoratorAdapter = class FileTreeDecoratorAdapter {
|
|
|
91
77
|
};
|
|
92
78
|
}
|
|
93
79
|
}
|
|
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
|
+
}
|
|
94
101
|
toTheiaDecoration(decorations, bubble) {
|
|
95
102
|
const color = decorations[0].colorId ? `var(${this.colorRegistry.toCssVariableName(decorations[0].colorId)})` : undefined;
|
|
96
103
|
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,mEAAm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C;IACL,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,IAAgB,EAAE,KAAiB;QACvD,OAAO,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;IACpD,CAAC;IAES,aAAa,CAAC,IAAc;QAClC,OAAO,wBAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,wBAAwB;QACpB,IAAI,CAAC,6BAA6B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;IACnF,CAAC;CACJ,CAAA;AApIY,4DAAwB;AAGc;IAA9C,IAAA,kBAAM,EAAC,wCAAkB,CAAC;;oEAA2D;AAC5C;IAAzC,IAAA,kBAAM,EAAC,8BAAa,CAAC;sCAAmC,8BAAa;+DAAC;AAW7D;IADT,IAAA,yBAAa,GAAE;;;;oDAMf;mCApBQ,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CAoIpC"}
|
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.50+f26609f54",
|
|
4
4
|
"description": "Theia - FileSystem Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.72.0-next.
|
|
6
|
+
"@theia/core": "1.72.0-next.50+f26609f54",
|
|
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": "f26609f5411c7101a4b2f540584b8163a6036131"
|
|
86
86
|
}
|
|
@@ -40,7 +40,10 @@ export class FileTreeDecoratorAdapter implements TreeDecorator {
|
|
|
40
40
|
|
|
41
41
|
@postConstruct()
|
|
42
42
|
protected init(): void {
|
|
43
|
-
this.decorationsService.onDidChangeDecorations(
|
|
43
|
+
this.decorationsService.onDidChangeDecorations(newDecorations => {
|
|
44
|
+
this.updateDecorations(this.decorationsByUri.keys(), newDecorations.keys());
|
|
45
|
+
this.fireDidChangeDecorations();
|
|
46
|
+
});
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
decorations(tree: Tree): MaybePromise<Map<string, TreeDecoration.Data>> {
|
|
@@ -48,36 +51,19 @@ export class FileTreeDecoratorAdapter implements TreeDecorator {
|
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
protected collectDecorations(tree: Tree): Map<string, TreeDecoration.Data> {
|
|
51
|
-
const decorations = new Map
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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);
|
|
54
|
+
const decorations = new Map();
|
|
55
|
+
if (tree.root) {
|
|
56
|
+
for (const node of new TopDownTreeIterator(tree.root)) {
|
|
57
|
+
const uri = this.getUriForNode(node);
|
|
58
|
+
if (uri) {
|
|
59
|
+
const stringified = uri.toString();
|
|
60
|
+
const ownDecoration = this.decorationsByUri.get(stringified);
|
|
61
|
+
const bubbledDecoration = this.parentDecorations.get(stringified);
|
|
62
|
+
const combined = this.mergeDecorations(ownDecoration, bubbledDecoration);
|
|
63
|
+
if (combined) {
|
|
64
|
+
decorations.set(node.id, combined);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
81
67
|
}
|
|
82
68
|
}
|
|
83
69
|
return decorations;
|
|
@@ -97,6 +83,28 @@ export class FileTreeDecoratorAdapter implements TreeDecorator {
|
|
|
97
83
|
}
|
|
98
84
|
}
|
|
99
85
|
|
|
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
|
+
|
|
100
108
|
protected toTheiaDecoration(decorations: Decoration[], bubble?: boolean): TreeDecoration.Data {
|
|
101
109
|
const color = decorations[0].colorId ? `var(${this.colorRegistry.toCssVariableName(decorations[0].colorId)})` : undefined;
|
|
102
110
|
const fontData = color ? { color } : undefined;
|