@theia/filesystem 1.55.0-next.4 → 1.55.0-next.67
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/breadcrumbs/filepath-breadcrumbs-container.d.ts +1 -2
- package/lib/browser/breadcrumbs/filepath-breadcrumbs-container.d.ts.map +1 -1
- package/lib/browser/breadcrumbs/filepath-breadcrumbs-container.js +0 -4
- package/lib/browser/breadcrumbs/filepath-breadcrumbs-container.js.map +1 -1
- package/lib/browser/file-dialog/file-dialog-widget.d.ts +2 -0
- package/lib/browser/file-dialog/file-dialog-widget.d.ts.map +1 -1
- package/lib/browser/file-dialog/file-dialog-widget.js +9 -0
- package/lib/browser/file-dialog/file-dialog-widget.js.map +1 -1
- package/lib/browser/file-tree/file-tree-model.d.ts +1 -5
- package/lib/browser/file-tree/file-tree-model.d.ts.map +1 -1
- package/lib/browser/file-tree/file-tree-model.js +0 -17
- package/lib/browser/file-tree/file-tree-model.js.map +1 -1
- package/lib/browser/file-upload-service.d.ts.map +1 -1
- package/lib/browser/file-upload-service.js +6 -0
- package/lib/browser/file-upload-service.js.map +1 -1
- package/lib/browser/filesystem-preferences.d.ts.map +1 -1
- package/lib/browser/filesystem-preferences.js +1 -2
- package/lib/browser/filesystem-preferences.js.map +1 -1
- package/lib/node/download/file-download-cache.d.ts.map +1 -1
- package/lib/node/download/file-download-cache.js +3 -5
- package/lib/node/download/file-download-cache.js.map +1 -1
- package/lib/node/filesystem-backend-module.d.ts +8 -8
- package/lib/node/filesystem-backend-module.d.ts.map +1 -1
- package/lib/node/filesystem-backend-module.js +27 -27
- package/lib/node/filesystem-backend-module.js.map +1 -1
- package/lib/node/filesystem-watcher-client.d.ts +1 -2
- package/lib/node/filesystem-watcher-client.d.ts.map +1 -1
- package/lib/node/filesystem-watcher-client.js +2 -3
- package/lib/node/filesystem-watcher-client.js.map +1 -1
- package/lib/node/node-file-upload-service.d.ts.map +1 -1
- package/lib/node/node-file-upload-service.js +8 -1
- package/lib/node/node-file-upload-service.js.map +1 -1
- package/lib/node/parcel-watcher/index.d.ts.map +1 -0
- package/lib/node/{nsfw-watcher → parcel-watcher}/index.js +3 -3
- package/lib/node/parcel-watcher/index.js.map +1 -0
- package/lib/node/{nsfw-watcher/nsfw-filesystem-service.d.ts → parcel-watcher/parcel-filesystem-service.d.ts} +29 -29
- package/lib/node/parcel-watcher/parcel-filesystem-service.d.ts.map +1 -0
- package/lib/node/{nsfw-watcher/nsfw-filesystem-service.js → parcel-watcher/parcel-filesystem-service.js} +55 -66
- package/lib/node/parcel-watcher/parcel-filesystem-service.js.map +1 -0
- package/lib/node/parcel-watcher/parcel-filesystem-watcher.spec.d.ts +2 -0
- package/lib/node/parcel-watcher/parcel-filesystem-watcher.spec.d.ts.map +1 -0
- package/lib/node/{nsfw-watcher/nsfw-filesystem-watcher.spec.js → parcel-watcher/parcel-filesystem-watcher.spec.js} +22 -29
- package/lib/node/parcel-watcher/parcel-filesystem-watcher.spec.js.map +1 -0
- package/lib/node/parcel-watcher/parcel-options.d.ts +7 -0
- package/lib/node/parcel-watcher/parcel-options.d.ts.map +1 -0
- package/lib/node/{nsfw-watcher/nsfw-options.js → parcel-watcher/parcel-options.js} +4 -4
- package/lib/node/parcel-watcher/parcel-options.js.map +1 -0
- package/package.json +5 -6
- package/src/browser/breadcrumbs/filepath-breadcrumbs-container.ts +1 -4
- package/src/browser/file-dialog/file-dialog-widget.ts +11 -0
- package/src/browser/file-tree/file-tree-model.ts +1 -19
- package/src/browser/file-upload-service.ts +5 -0
- package/src/browser/filesystem-preferences.ts +1 -2
- package/src/node/download/file-download-cache.ts +3 -5
- package/src/node/filesystem-backend-module.ts +27 -27
- package/src/node/filesystem-watcher-client.ts +1 -3
- package/src/node/node-file-upload-service.ts +7 -1
- package/src/node/{nsfw-watcher → parcel-watcher}/index.ts +3 -3
- package/src/node/{nsfw-watcher/nsfw-filesystem-service.ts → parcel-watcher/parcel-filesystem-service.ts} +62 -72
- package/src/node/{nsfw-watcher/nsfw-filesystem-watcher.spec.ts → parcel-watcher/parcel-filesystem-watcher.spec.ts} +22 -29
- package/src/node/{nsfw-watcher/nsfw-options.ts → parcel-watcher/parcel-options.ts} +4 -4
- package/lib/node/nsfw-watcher/index.d.ts.map +0 -1
- package/lib/node/nsfw-watcher/index.js.map +0 -1
- package/lib/node/nsfw-watcher/nsfw-filesystem-service.d.ts.map +0 -1
- package/lib/node/nsfw-watcher/nsfw-filesystem-service.js.map +0 -1
- package/lib/node/nsfw-watcher/nsfw-filesystem-watcher.spec.d.ts +0 -2
- package/lib/node/nsfw-watcher/nsfw-filesystem-watcher.spec.d.ts.map +0 -1
- package/lib/node/nsfw-watcher/nsfw-filesystem-watcher.spec.js.map +0 -1
- package/lib/node/nsfw-watcher/nsfw-options.d.ts +0 -7
- package/lib/node/nsfw-watcher/nsfw-options.d.ts.map +0 -1
- package/lib/node/nsfw-watcher/nsfw-options.js.map +0 -1
- package/src/typings/nsfw/index.d.ts +0 -18
- /package/lib/node/{nsfw-watcher → parcel-watcher}/index.d.ts +0 -0
|
@@ -21,10 +21,10 @@ const cp = require("child_process");
|
|
|
21
21
|
const fs = require("@theia/core/shared/fs-extra");
|
|
22
22
|
const assert = require("assert");
|
|
23
23
|
const node_1 = require("@theia/core/lib/node");
|
|
24
|
-
const
|
|
24
|
+
const parcel_filesystem_service_1 = require("./parcel-filesystem-service");
|
|
25
25
|
const expect = chai.expect;
|
|
26
26
|
const track = temp.track();
|
|
27
|
-
describe('
|
|
27
|
+
describe('parcel-filesystem-watcher', function () {
|
|
28
28
|
let root;
|
|
29
29
|
let watcherService;
|
|
30
30
|
let watcherId;
|
|
@@ -32,7 +32,7 @@ describe('nsfw-filesystem-watcher', function () {
|
|
|
32
32
|
beforeEach(async () => {
|
|
33
33
|
let tempPath = temp.mkdirSync('node-fs-root');
|
|
34
34
|
// Sometimes tempPath will use some Windows 8.3 short name in its path. This is a problem
|
|
35
|
-
// since
|
|
35
|
+
// since parcel always returns paths with long names. We need to convert here.
|
|
36
36
|
// See: https://stackoverflow.com/a/34473971/7983255
|
|
37
37
|
if (process.platform === 'win32') {
|
|
38
38
|
tempPath = cp.execSync(`powershell "(Get-Item -LiteralPath '${tempPath}').FullName"`, {
|
|
@@ -40,9 +40,9 @@ describe('nsfw-filesystem-watcher', function () {
|
|
|
40
40
|
}).trim();
|
|
41
41
|
}
|
|
42
42
|
root = node_1.FileUri.create(fs.realpathSync(tempPath));
|
|
43
|
-
watcherService =
|
|
43
|
+
watcherService = createParcelFileSystemWatcherService();
|
|
44
44
|
watcherId = await watcherService.watchFileChanges(0, root.toString());
|
|
45
|
-
await sleep(
|
|
45
|
+
await sleep(200);
|
|
46
46
|
});
|
|
47
47
|
afterEach(async () => {
|
|
48
48
|
track.cleanupSync();
|
|
@@ -65,13 +65,13 @@ describe('nsfw-filesystem-watcher', function () {
|
|
|
65
65
|
];
|
|
66
66
|
fs.mkdirSync(node_1.FileUri.fsPath(root.resolve('foo')));
|
|
67
67
|
expect(fs.statSync(node_1.FileUri.fsPath(root.resolve('foo'))).isDirectory()).to.be.true;
|
|
68
|
-
await sleep(
|
|
68
|
+
await sleep(200);
|
|
69
69
|
fs.mkdirSync(node_1.FileUri.fsPath(root.resolve('foo').resolve('bar')));
|
|
70
70
|
expect(fs.statSync(node_1.FileUri.fsPath(root.resolve('foo').resolve('bar'))).isDirectory()).to.be.true;
|
|
71
|
-
await sleep(
|
|
71
|
+
await sleep(200);
|
|
72
72
|
fs.writeFileSync(node_1.FileUri.fsPath(root.resolve('foo').resolve('bar').resolve('baz.txt')), 'baz');
|
|
73
73
|
expect(fs.readFileSync(node_1.FileUri.fsPath(root.resolve('foo').resolve('bar').resolve('baz.txt')), 'utf8')).to.be.equal('baz');
|
|
74
|
-
await sleep(
|
|
74
|
+
await sleep(200);
|
|
75
75
|
assert.deepStrictEqual([...actualUris], expectedUris);
|
|
76
76
|
});
|
|
77
77
|
it('Should not receive file changes events from in the workspace by default if unwatched', async function () {
|
|
@@ -88,16 +88,16 @@ describe('nsfw-filesystem-watcher', function () {
|
|
|
88
88
|
await watcherService.unwatchFileChanges(watcherId);
|
|
89
89
|
fs.mkdirSync(node_1.FileUri.fsPath(root.resolve('foo')));
|
|
90
90
|
expect(fs.statSync(node_1.FileUri.fsPath(root.resolve('foo'))).isDirectory()).to.be.true;
|
|
91
|
-
await sleep(
|
|
91
|
+
await sleep(200);
|
|
92
92
|
fs.mkdirSync(node_1.FileUri.fsPath(root.resolve('foo').resolve('bar')));
|
|
93
93
|
expect(fs.statSync(node_1.FileUri.fsPath(root.resolve('foo').resolve('bar'))).isDirectory()).to.be.true;
|
|
94
|
-
await sleep(
|
|
94
|
+
await sleep(200);
|
|
95
95
|
fs.writeFileSync(node_1.FileUri.fsPath(root.resolve('foo').resolve('bar').resolve('baz.txt')), 'baz');
|
|
96
96
|
expect(fs.readFileSync(node_1.FileUri.fsPath(root.resolve('foo').resolve('bar').resolve('baz.txt')), 'utf8')).to.be.equal('baz');
|
|
97
|
-
await sleep(
|
|
97
|
+
await sleep(200);
|
|
98
98
|
assert.deepStrictEqual(actualUris.size, 0);
|
|
99
99
|
});
|
|
100
|
-
it('Renaming should emit a DELETED
|
|
100
|
+
it('Renaming should emit a DELETED and ADDED event', async function () {
|
|
101
101
|
const file_txt = root.resolve('file.txt');
|
|
102
102
|
const FILE_txt = root.resolve('FILE.txt');
|
|
103
103
|
const changes = [];
|
|
@@ -106,38 +106,31 @@ describe('nsfw-filesystem-watcher', function () {
|
|
|
106
106
|
onError: console.error
|
|
107
107
|
});
|
|
108
108
|
await fs.promises.writeFile(node_1.FileUri.fsPath(file_txt), 'random content\n');
|
|
109
|
-
await sleep(
|
|
109
|
+
await sleep(200);
|
|
110
110
|
await fs.promises.rename(node_1.FileUri.fsPath(file_txt), node_1.FileUri.fsPath(FILE_txt));
|
|
111
|
-
await sleep(
|
|
111
|
+
await sleep(200);
|
|
112
|
+
// The order of DELETED and ADDED is not deterministic
|
|
112
113
|
try {
|
|
113
114
|
expect(changes).deep.eq([
|
|
114
115
|
// initial file creation change event:
|
|
115
116
|
{ type: 1 /* FileChangeType.ADDED */, uri: file_txt.toString() },
|
|
116
117
|
// rename change events:
|
|
117
118
|
{ type: 2 /* FileChangeType.DELETED */, uri: file_txt.toString() },
|
|
118
|
-
{ type: 1 /* FileChangeType.ADDED */, uri: FILE_txt.toString() }
|
|
119
|
+
{ type: 1 /* FileChangeType.ADDED */, uri: FILE_txt.toString() },
|
|
119
120
|
]);
|
|
120
121
|
}
|
|
121
|
-
catch
|
|
122
|
-
// TODO: remove this try/catch once the bug on macOS is fixed.
|
|
123
|
-
// See https://github.com/Axosoft/nsfw/issues/146
|
|
124
|
-
if (process.platform !== 'darwin') {
|
|
125
|
-
throw error;
|
|
126
|
-
}
|
|
127
|
-
// On macOS we only get ADDED events for some reason
|
|
122
|
+
catch {
|
|
128
123
|
expect(changes).deep.eq([
|
|
129
124
|
// initial file creation change event:
|
|
130
125
|
{ type: 1 /* FileChangeType.ADDED */, uri: file_txt.toString() },
|
|
131
126
|
// rename change events:
|
|
132
|
-
{ type: 1 /* FileChangeType.ADDED */, uri:
|
|
133
|
-
{ type:
|
|
127
|
+
{ type: 1 /* FileChangeType.ADDED */, uri: FILE_txt.toString() },
|
|
128
|
+
{ type: 2 /* FileChangeType.DELETED */, uri: file_txt.toString() },
|
|
134
129
|
]);
|
|
135
|
-
// Mark the test case as skipped so it stands out that the bogus branch got tested
|
|
136
|
-
this.skip();
|
|
137
130
|
}
|
|
138
131
|
});
|
|
139
|
-
function
|
|
140
|
-
return new
|
|
132
|
+
function createParcelFileSystemWatcherService() {
|
|
133
|
+
return new parcel_filesystem_service_1.ParcelFileSystemWatcherService({
|
|
141
134
|
verbose: true
|
|
142
135
|
});
|
|
143
136
|
}
|
|
@@ -149,4 +142,4 @@ describe('nsfw-filesystem-watcher', function () {
|
|
|
149
142
|
process.on('unhandledRejection', (reason) => {
|
|
150
143
|
console.error('Unhandled promise rejection: ' + reason);
|
|
151
144
|
});
|
|
152
|
-
//# sourceMappingURL=
|
|
145
|
+
//# sourceMappingURL=parcel-filesystem-watcher.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parcel-filesystem-watcher.spec.js","sourceRoot":"","sources":["../../../src/node/parcel-watcher/parcel-filesystem-watcher.spec.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,6BAA6B;AAC7B,6BAA6B;AAC7B,oCAAoC;AACpC,kDAAkD;AAClD,iCAAiC;AAEjC,+CAA+C;AAC/C,2EAA6E;AAG7E,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;AAE3B,QAAQ,CAAC,2BAA2B,EAAE;IAElC,IAAI,IAAS,CAAC;IACd,IAAI,cAA8C,CAAC;IACnD,IAAI,SAAiB,CAAC;IAEtB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAErB,UAAU,CAAC,KAAK,IAAI,EAAE;QAClB,IAAI,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QAC9C,yFAAyF;QACzF,8EAA8E;QAC9E,oDAAoD;QACpD,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;YAC/B,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC,uCAAuC,QAAQ,cAAc,EAAE;gBAClF,QAAQ,EAAE,MAAM;aACnB,CAAC,CAAC,IAAI,EAAE,CAAC;QACd,CAAC;QACD,IAAI,GAAG,cAAO,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,C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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Options } from '@theia/core/shared/@parcel/watcher';
|
|
2
|
+
/**
|
|
3
|
+
* Inversify service identifier allowing extensions to override options passed to parcel by the file watcher.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ParcelWatcherOptions: unique symbol;
|
|
6
|
+
export type ParcelWatcherOptions = Options;
|
|
7
|
+
//# sourceMappingURL=parcel-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parcel-options.d.ts","sourceRoot":"","sources":["../../../src/node/parcel-watcher/parcel-options.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC"}
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
16
|
// *****************************************************************************
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
18
|
+
exports.ParcelWatcherOptions = void 0;
|
|
19
19
|
/**
|
|
20
|
-
* Inversify service identifier allowing extensions to override options passed to
|
|
20
|
+
* Inversify service identifier allowing extensions to override options passed to parcel by the file watcher.
|
|
21
21
|
*/
|
|
22
|
-
exports.
|
|
23
|
-
//# sourceMappingURL=
|
|
22
|
+
exports.ParcelWatcherOptions = Symbol('ParcelWatcherOptions');
|
|
23
|
+
//# sourceMappingURL=parcel-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parcel-options.js","sourceRoot":"","sources":["../../../src/node/parcel-watcher/parcel-options.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,8CAA8C;AAC9C,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;;;AAIhF;;GAEG;AACU,QAAA,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/filesystem",
|
|
3
|
-
"version": "1.55.0-next.
|
|
3
|
+
"version": "1.55.0-next.67+8664face6",
|
|
4
4
|
"description": "Theia - FileSystem Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.55.0-next.
|
|
6
|
+
"@theia/core": "1.55.0-next.67+8664face6",
|
|
7
7
|
"@types/body-parser": "^1.17.0",
|
|
8
8
|
"@types/multer": "^1.4.7",
|
|
9
|
-
"@types/rimraf": "^2.0.2",
|
|
10
9
|
"@types/tar-fs": "^1.16.1",
|
|
11
10
|
"async-mutex": "^0.3.1",
|
|
12
11
|
"body-parser": "^1.18.3",
|
|
@@ -14,7 +13,7 @@
|
|
|
14
13
|
"http-status-codes": "^1.3.0",
|
|
15
14
|
"minimatch": "^5.1.0",
|
|
16
15
|
"multer": "1.4.4-lts.1",
|
|
17
|
-
"rimraf": "^
|
|
16
|
+
"rimraf": "^5.0.0",
|
|
18
17
|
"stat-mode": "^1.0.0",
|
|
19
18
|
"tar-fs": "^1.16.2",
|
|
20
19
|
"trash": "^7.2.0",
|
|
@@ -73,10 +72,10 @@
|
|
|
73
72
|
"watch": "theiaext watch"
|
|
74
73
|
},
|
|
75
74
|
"devDependencies": {
|
|
76
|
-
"@theia/ext-scripts": "1.
|
|
75
|
+
"@theia/ext-scripts": "1.55.0"
|
|
77
76
|
},
|
|
78
77
|
"nyc": {
|
|
79
78
|
"extends": "../../configs/nyc.json"
|
|
80
79
|
},
|
|
81
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "8664face680c050b8d544a381645259b6821a634"
|
|
82
81
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { Container, interfaces, injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
-
import { TreeProps, ContextMenuRenderer, TreeNode,
|
|
18
|
+
import { TreeProps, ContextMenuRenderer, TreeNode, open, NodeProps, defaultTreeProps } from '@theia/core/lib/browser';
|
|
19
19
|
import { FileTreeModel, FileStatNode, createFileTreeContainer, FileTreeWidget } from '../file-tree';
|
|
20
20
|
|
|
21
21
|
const BREADCRUMBS_FILETREE_CLASS = 'theia-FilepathBreadcrumbFileTree';
|
|
@@ -35,9 +35,6 @@ export function createFileTreeBreadcrumbsWidget(parent: interfaces.Container): B
|
|
|
35
35
|
@injectable()
|
|
36
36
|
export class BreadcrumbsFileTreeWidget extends FileTreeWidget {
|
|
37
37
|
|
|
38
|
-
@inject(OpenerService)
|
|
39
|
-
protected readonly openerService: OpenerService;
|
|
40
|
-
|
|
41
38
|
constructor(
|
|
42
39
|
@inject(TreeProps) props: TreeProps,
|
|
43
40
|
@inject(FileTreeModel) override readonly model: FileTreeModel,
|
|
@@ -55,6 +55,17 @@ export class FileDialogWidget extends FileTreeWidget {
|
|
|
55
55
|
return attr;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
protected override handleEnter(event: KeyboardEvent): boolean | void {
|
|
59
|
+
// Handle ENTER in the dialog to Accept.
|
|
60
|
+
// Tree view will just expand/collapse the node. This works also with arrow keys or SPACE.
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
protected override handleEscape(event: KeyboardEvent): boolean | void {
|
|
65
|
+
// Handle ESC in the dialog to Cancel and close the Dialog.
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
|
|
58
69
|
protected override createNodeClassNames(node: TreeNode, props: NodeProps): string[] {
|
|
59
70
|
const classNames = super.createNodeClassNames(node, props);
|
|
60
71
|
if (this.shouldDisableSelection(node)) {
|
|
@@ -21,7 +21,7 @@ import { FileStatNode, DirNode, FileNode } from './file-tree';
|
|
|
21
21
|
import { LocationService } from '../location';
|
|
22
22
|
import { LabelProvider } from '@theia/core/lib/browser/label-provider';
|
|
23
23
|
import { FileService } from '../file-service';
|
|
24
|
-
import { FileOperationError, FileOperationResult, FileChangesEvent, FileChangeType, FileChange
|
|
24
|
+
import { FileOperationError, FileOperationResult, FileChangesEvent, FileChangeType, FileChange } from '../../common/files';
|
|
25
25
|
import { MessageService } from '@theia/core/lib/common/message-service';
|
|
26
26
|
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
|
27
27
|
import { FileSystemUtils } from '../../common';
|
|
@@ -45,7 +45,6 @@ export class FileTreeModel extends CompressedTreeModel implements LocationServic
|
|
|
45
45
|
protected override init(): void {
|
|
46
46
|
super.init();
|
|
47
47
|
this.toDispose.push(this.fileService.onDidFilesChange(changes => this.onFilesChanged(changes)));
|
|
48
|
-
this.toDispose.push(this.fileService.onDidRunOperation(event => this.onDidMove(event)));
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
get location(): URI | undefined {
|
|
@@ -92,23 +91,6 @@ export class FileTreeModel extends CompressedTreeModel implements LocationServic
|
|
|
92
91
|
}
|
|
93
92
|
}
|
|
94
93
|
|
|
95
|
-
/**
|
|
96
|
-
* to workaround https://github.com/Axosoft/nsfw/issues/42
|
|
97
|
-
*/
|
|
98
|
-
protected onDidMove(event: FileOperationEvent): void {
|
|
99
|
-
if (!event.isOperation(FileOperation.MOVE)) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
if (event.resource.parent.toString() === event.target.resource.parent.toString()) {
|
|
103
|
-
// file rename
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
this.refreshAffectedNodes([
|
|
107
|
-
event.resource,
|
|
108
|
-
event.target.resource
|
|
109
|
-
]);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
94
|
protected onFilesChanged(changes: FileChangesEvent): void {
|
|
113
95
|
if (!this.refreshAffectedNodes(this.getAffectedUris(changes)) && this.isRootAffected(changes)) {
|
|
114
96
|
this.refresh();
|
|
@@ -254,6 +254,7 @@ export class FileUploadService {
|
|
|
254
254
|
} catch (error) {
|
|
255
255
|
uploadSemaphore.cancel();
|
|
256
256
|
if (!isCancelled(error)) {
|
|
257
|
+
this.messageService.error(nls.localize('theia/filesystem/uploadFailed', 'An error occurred while uploading a file. {0}', error.message));
|
|
257
258
|
throw error;
|
|
258
259
|
}
|
|
259
260
|
}
|
|
@@ -348,6 +349,10 @@ export class FileUploadService {
|
|
|
348
349
|
unregister();
|
|
349
350
|
if (xhr.status === 200) {
|
|
350
351
|
resolve();
|
|
352
|
+
} else if (xhr.status === 500 && xhr.statusText !== xhr.response) {
|
|
353
|
+
// internal error with cause message
|
|
354
|
+
// see packages/filesystem/src/node/node-file-upload-service.ts
|
|
355
|
+
reject(new Error(`Internal server error: ${xhr.response}`));
|
|
351
356
|
} else {
|
|
352
357
|
reject(new Error(`POST request failed: ${xhr.status} ${xhr.statusText}`));
|
|
353
358
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
17
17
|
import { ILogger } from '@theia/core/lib/common/logger';
|
|
18
|
-
import
|
|
18
|
+
import { rimraf } from 'rimraf';
|
|
19
19
|
|
|
20
20
|
export interface DownloadStorageItem {
|
|
21
21
|
file: string;
|
|
@@ -70,10 +70,8 @@ export class FileDownloadCache {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
protected deleteRecursively(pathToDelete: string): void {
|
|
73
|
-
rimraf(pathToDelete
|
|
74
|
-
|
|
75
|
-
this.logger.warn(`An error occurred while deleting the temporary data from the disk. Cannot clean up: ${pathToDelete}.`, error);
|
|
76
|
-
}
|
|
73
|
+
rimraf(pathToDelete).catch(error => {
|
|
74
|
+
this.logger.warn(`An error occurred while deleting the temporary data from the disk. Cannot clean up: ${pathToDelete}.`, error);
|
|
77
75
|
});
|
|
78
76
|
}
|
|
79
77
|
|
|
@@ -19,9 +19,9 @@ import { ContainerModule, interfaces } from '@theia/core/shared/inversify';
|
|
|
19
19
|
import { ConnectionHandler, RpcConnectionHandler, ILogger } from '@theia/core/lib/common';
|
|
20
20
|
import { FileSystemWatcherServer, FileSystemWatcherService } from '../common/filesystem-watcher-protocol';
|
|
21
21
|
import { FileSystemWatcherServerClient } from './filesystem-watcher-client';
|
|
22
|
-
import {
|
|
22
|
+
import { ParcelFileSystemWatcherService, ParcelFileSystemWatcherServerOptions } from './parcel-watcher/parcel-filesystem-service';
|
|
23
23
|
import { NodeFileUploadService } from './node-file-upload-service';
|
|
24
|
-
import {
|
|
24
|
+
import { ParcelWatcherOptions } from './parcel-watcher/parcel-options';
|
|
25
25
|
import { DiskFileSystemProvider } from './disk-file-system-provider';
|
|
26
26
|
import {
|
|
27
27
|
remoteFileSystemPath, RemoteFileSystemServer, RemoteFileSystemClient, FileSystemProviderServer, RemoteFileSystemProxyFactory
|
|
@@ -32,16 +32,16 @@ import { BackendApplicationContribution, IPCConnectionProvider } from '@theia/co
|
|
|
32
32
|
import { RpcProxyFactory, ConnectionErrorHandler } from '@theia/core';
|
|
33
33
|
import { FileSystemWatcherServiceDispatcher } from './filesystem-watcher-dispatcher';
|
|
34
34
|
|
|
35
|
-
export const
|
|
36
|
-
export const
|
|
35
|
+
export const WATCHER_SINGLE_THREADED = process.argv.includes('--no-cluster');
|
|
36
|
+
export const WATCHER_VERBOSE = process.argv.includes('--watcher-verbose');
|
|
37
37
|
|
|
38
|
-
export const
|
|
38
|
+
export const FileSystemWatcherServiceProcessOptions = Symbol('FileSystemWatcherServiceProcessOptions');
|
|
39
39
|
/**
|
|
40
|
-
* Options to control the way the `
|
|
40
|
+
* Options to control the way the `ParcelFileSystemWatcherService` process is spawned.
|
|
41
41
|
*/
|
|
42
|
-
export interface
|
|
42
|
+
export interface FileSystemWatcherServiceProcessOptions {
|
|
43
43
|
/**
|
|
44
|
-
* Path to the script that will run the `
|
|
44
|
+
* Path to the script that will run the `ParcelFileSystemWatcherService` in a new process.
|
|
45
45
|
*/
|
|
46
46
|
entryPoint: string;
|
|
47
47
|
}
|
|
@@ -66,41 +66,41 @@ export default new ContainerModule(bind => {
|
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
export function bindFileSystemWatcherServer(bind: interfaces.Bind): void {
|
|
69
|
-
bind<
|
|
69
|
+
bind<ParcelWatcherOptions>(ParcelWatcherOptions).toConstantValue({});
|
|
70
70
|
|
|
71
71
|
bind(FileSystemWatcherServiceDispatcher).toSelf().inSingletonScope();
|
|
72
72
|
|
|
73
73
|
bind(FileSystemWatcherServerClient).toSelf();
|
|
74
74
|
bind(FileSystemWatcherServer).toService(FileSystemWatcherServerClient);
|
|
75
75
|
|
|
76
|
-
bind<
|
|
77
|
-
entryPoint: path.join(__dirname, '
|
|
76
|
+
bind<FileSystemWatcherServiceProcessOptions>(FileSystemWatcherServiceProcessOptions).toDynamicValue(ctx => ({
|
|
77
|
+
entryPoint: path.join(__dirname, 'parcel-watcher'),
|
|
78
78
|
})).inSingletonScope();
|
|
79
|
-
bind<
|
|
79
|
+
bind<ParcelFileSystemWatcherServerOptions>(ParcelFileSystemWatcherServerOptions).toDynamicValue(ctx => {
|
|
80
80
|
const logger = ctx.container.get<ILogger>(ILogger);
|
|
81
|
-
const
|
|
81
|
+
const watcherOptions = ctx.container.get<ParcelWatcherOptions>(ParcelWatcherOptions);
|
|
82
82
|
return {
|
|
83
|
-
|
|
84
|
-
verbose:
|
|
83
|
+
parcelOptions: watcherOptions,
|
|
84
|
+
verbose: WATCHER_VERBOSE,
|
|
85
85
|
info: (message, ...args) => logger.info(message, ...args),
|
|
86
86
|
error: (message, ...args) => logger.error(message, ...args),
|
|
87
87
|
};
|
|
88
88
|
}).inSingletonScope();
|
|
89
89
|
|
|
90
90
|
bind<FileSystemWatcherService>(FileSystemWatcherService).toDynamicValue(
|
|
91
|
-
ctx =>
|
|
92
|
-
?
|
|
93
|
-
:
|
|
91
|
+
ctx => WATCHER_SINGLE_THREADED
|
|
92
|
+
? createParcelFileSystemWatcherService(ctx)
|
|
93
|
+
: spawnParcelFileSystemWatcherServiceProcess(ctx)
|
|
94
94
|
).inSingletonScope();
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
98
|
* Run the watch server in the current process.
|
|
99
99
|
*/
|
|
100
|
-
export function
|
|
101
|
-
const options = ctx.container.get<
|
|
100
|
+
export function createParcelFileSystemWatcherService(ctx: interfaces.Context): FileSystemWatcherService {
|
|
101
|
+
const options = ctx.container.get<ParcelFileSystemWatcherServerOptions>(ParcelFileSystemWatcherServerOptions);
|
|
102
102
|
const dispatcher = ctx.container.get<FileSystemWatcherServiceDispatcher>(FileSystemWatcherServiceDispatcher);
|
|
103
|
-
const server = new
|
|
103
|
+
const server = new ParcelFileSystemWatcherService(options);
|
|
104
104
|
server.setClient(dispatcher);
|
|
105
105
|
return server;
|
|
106
106
|
}
|
|
@@ -109,21 +109,21 @@ export function createNsfwFileSystemWatcherService(ctx: interfaces.Context): Fil
|
|
|
109
109
|
* Run the watch server in a child process.
|
|
110
110
|
* Return a proxy forwarding calls to the child process.
|
|
111
111
|
*/
|
|
112
|
-
export function
|
|
113
|
-
const options = ctx.container.get<
|
|
112
|
+
export function spawnParcelFileSystemWatcherServiceProcess(ctx: interfaces.Context): FileSystemWatcherService {
|
|
113
|
+
const options = ctx.container.get<FileSystemWatcherServiceProcessOptions>(FileSystemWatcherServiceProcessOptions);
|
|
114
114
|
const dispatcher = ctx.container.get<FileSystemWatcherServiceDispatcher>(FileSystemWatcherServiceDispatcher);
|
|
115
|
-
const serverName = '
|
|
115
|
+
const serverName = 'parcel-watcher';
|
|
116
116
|
const logger = ctx.container.get<ILogger>(ILogger);
|
|
117
|
-
const
|
|
117
|
+
const watcherOptions = ctx.container.get<ParcelWatcherOptions>(ParcelWatcherOptions);
|
|
118
118
|
const ipcConnectionProvider = ctx.container.get<IPCConnectionProvider>(IPCConnectionProvider);
|
|
119
119
|
const proxyFactory = new RpcProxyFactory<FileSystemWatcherService>();
|
|
120
120
|
const serverProxy = proxyFactory.createProxy();
|
|
121
121
|
// We need to call `.setClient` before listening, else the JSON-RPC calls won't go through.
|
|
122
122
|
serverProxy.setClient(dispatcher);
|
|
123
123
|
const args: string[] = [
|
|
124
|
-
`--
|
|
124
|
+
`--watchOptions=${JSON.stringify(watcherOptions)}`
|
|
125
125
|
];
|
|
126
|
-
if (
|
|
126
|
+
if (WATCHER_VERBOSE) {
|
|
127
127
|
args.push('--verbose');
|
|
128
128
|
}
|
|
129
129
|
ipcConnectionProvider.listen({
|
|
@@ -18,10 +18,8 @@ import { injectable, inject } from '@theia/core/shared/inversify';
|
|
|
18
18
|
import { FileSystemWatcherServer, WatchOptions, FileSystemWatcherClient, FileSystemWatcherService } from '../common/filesystem-watcher-protocol';
|
|
19
19
|
import { FileSystemWatcherServiceDispatcher } from './filesystem-watcher-dispatcher';
|
|
20
20
|
|
|
21
|
-
export const NSFW_WATCHER = 'nsfw-watcher';
|
|
22
|
-
|
|
23
21
|
/**
|
|
24
|
-
* Wraps the
|
|
22
|
+
* Wraps the watcher singleton service for each frontend.
|
|
25
23
|
*/
|
|
26
24
|
@injectable()
|
|
27
25
|
export class FileSystemWatcherServerClient implements FileSystemWatcherServer {
|
|
@@ -73,7 +73,13 @@ export class NodeFileUploadService implements BackendApplicationContribution {
|
|
|
73
73
|
response.status(200).send(target); // ok
|
|
74
74
|
} catch (error) {
|
|
75
75
|
console.error(error);
|
|
76
|
-
|
|
76
|
+
if (error.message) {
|
|
77
|
+
// internal server error with error message as response
|
|
78
|
+
response.status(500).send(error.message);
|
|
79
|
+
} else {
|
|
80
|
+
// default internal server error
|
|
81
|
+
response.sendStatus(500);
|
|
82
|
+
}
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
85
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import * as yargs from '@theia/core/shared/yargs';
|
|
18
18
|
import { RpcProxyFactory } from '@theia/core';
|
|
19
19
|
import { FileSystemWatcherServiceClient } from '../../common/filesystem-watcher-protocol';
|
|
20
|
-
import {
|
|
20
|
+
import { ParcelFileSystemWatcherService } from './parcel-filesystem-service';
|
|
21
21
|
import { IPCEntryPoint } from '@theia/core/lib/node/messaging/ipc-protocol';
|
|
22
22
|
|
|
23
23
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -30,7 +30,7 @@ const options: {
|
|
|
30
30
|
alias: 'v',
|
|
31
31
|
type: 'boolean'
|
|
32
32
|
})
|
|
33
|
-
.option('
|
|
33
|
+
.option('watchOptions', {
|
|
34
34
|
alias: 'o',
|
|
35
35
|
type: 'string',
|
|
36
36
|
coerce: JSON.parse
|
|
@@ -38,7 +38,7 @@ const options: {
|
|
|
38
38
|
.argv as any;
|
|
39
39
|
|
|
40
40
|
export default <IPCEntryPoint>(connection => {
|
|
41
|
-
const server = new
|
|
41
|
+
const server = new ParcelFileSystemWatcherService(options);
|
|
42
42
|
const factory = new RpcProxyFactory<FileSystemWatcherServiceClient>(server);
|
|
43
43
|
server.setClient(factory.createProxy());
|
|
44
44
|
factory.listen(connection);
|