@codingame/monaco-vscode-dialogs-service-override 1.83.16 → 1.85.0-next.0
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/package.json +4 -4
- package/vscode/src/vs/workbench/browser/parts/dialogs/dialog.web.contribution.js +18 -13
- package/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.js +2 -2
- package/vscode/src/vs/workbench/common/dialogs.js +6 -1
- package/vscode/src/vs/workbench/services/dialogs/browser/abstractFileDialogService.js +9 -6
- package/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.js +3 -2
- package/vscode/src/vs/workbench/services/dialogs/common/dialogService.js +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-dialogs-service-override",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.85.0-next.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.
|
|
22
|
-
"monaco-editor": "0.
|
|
23
|
-
"@codingame/monaco-vscode-layout-service-override": "1.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.85.0-next.0",
|
|
22
|
+
"monaco-editor": "0.45.0",
|
|
23
|
+
"@codingame/monaco-vscode-layout-service-override": "1.85.0-next.0"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -36,20 +36,25 @@ let DialogHandlerContribution = class DialogHandlerContribution extends Disposab
|
|
|
36
36
|
while (this.model.dialogs.length) {
|
|
37
37
|
this.currentDialog = this.model.dialogs[0];
|
|
38
38
|
let result = undefined;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
try {
|
|
40
|
+
if (this.currentDialog.args.confirmArgs) {
|
|
41
|
+
const args = this.currentDialog.args.confirmArgs;
|
|
42
|
+
result = await this.impl.confirm(args.confirmation);
|
|
43
|
+
}
|
|
44
|
+
else if (this.currentDialog.args.inputArgs) {
|
|
45
|
+
const args = this.currentDialog.args.inputArgs;
|
|
46
|
+
result = await this.impl.input(args.input);
|
|
47
|
+
}
|
|
48
|
+
else if (this.currentDialog.args.promptArgs) {
|
|
49
|
+
const args = this.currentDialog.args.promptArgs;
|
|
50
|
+
result = await this.impl.prompt(args.prompt);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
await this.impl.about();
|
|
54
|
+
}
|
|
42
55
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
result = await this.impl.input(args.input);
|
|
46
|
-
}
|
|
47
|
-
else if (this.currentDialog.args.promptArgs) {
|
|
48
|
-
const args = this.currentDialog.args.promptArgs;
|
|
49
|
-
result = await this.impl.prompt(args.prompt);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
await this.impl.about();
|
|
56
|
+
catch (error) {
|
|
57
|
+
result = error;
|
|
53
58
|
}
|
|
54
59
|
this.currentDialog.close(result);
|
|
55
60
|
this.currentDialog = undefined;
|
|
@@ -92,12 +92,12 @@ let BrowserDialogHandler = class BrowserDialogHandler extends AbstractDialogHand
|
|
|
92
92
|
dialogDisposables.add(result);
|
|
93
93
|
});
|
|
94
94
|
} : undefined;
|
|
95
|
-
const dialog = ( new Dialog(this.layoutService.
|
|
95
|
+
const dialog = ( new Dialog(this.layoutService.activeContainer, message, buttons, {
|
|
96
96
|
detail,
|
|
97
97
|
cancelId,
|
|
98
98
|
type: this.getDialogType(type),
|
|
99
99
|
keyEventProcessor: (event) => {
|
|
100
|
-
const resolved = this.keybindingService.softDispatch(event, this.layoutService.
|
|
100
|
+
const resolved = this.keybindingService.softDispatch(event, this.layoutService.activeContainer);
|
|
101
101
|
if (resolved.kind === 2 && resolved.commandId) {
|
|
102
102
|
if (BrowserDialogHandler_1.ALLOWABLE_COMMANDS.indexOf(resolved.commandId) === -1) {
|
|
103
103
|
EventHelper.stop(event, true);
|
|
@@ -17,7 +17,12 @@ class DialogsModel extends Disposable {
|
|
|
17
17
|
args: dialog,
|
|
18
18
|
close: result => {
|
|
19
19
|
this.dialogs.splice(0, 1);
|
|
20
|
-
|
|
20
|
+
if (result instanceof Error) {
|
|
21
|
+
promise.error(result);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
promise.complete(result);
|
|
25
|
+
}
|
|
21
26
|
this._onDidShowDialog.fire();
|
|
22
27
|
}
|
|
23
28
|
};
|
|
@@ -49,10 +49,10 @@ let AbstractFileDialogService = class AbstractFileDialogService {
|
|
|
49
49
|
this.codeEditorService = codeEditorService;
|
|
50
50
|
this.logService = logService;
|
|
51
51
|
}
|
|
52
|
-
async defaultFilePath(schemeFilter = this.getSchemeFilterForWindow()) {
|
|
53
|
-
let candidate = this.historyService.getLastActiveFile(schemeFilter);
|
|
52
|
+
async defaultFilePath(schemeFilter = this.getSchemeFilterForWindow(), authorityFilter = this.getAuthorityFilterForWindow()) {
|
|
53
|
+
let candidate = this.historyService.getLastActiveFile(schemeFilter, authorityFilter);
|
|
54
54
|
if (!candidate) {
|
|
55
|
-
candidate = this.historyService.getLastActiveWorkspaceRoot(schemeFilter);
|
|
55
|
+
candidate = this.historyService.getLastActiveWorkspaceRoot(schemeFilter, authorityFilter);
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
58
58
|
candidate = resources.dirname(candidate);
|
|
@@ -62,10 +62,10 @@ let AbstractFileDialogService = class AbstractFileDialogService {
|
|
|
62
62
|
}
|
|
63
63
|
return candidate;
|
|
64
64
|
}
|
|
65
|
-
async defaultFolderPath(schemeFilter = this.getSchemeFilterForWindow()) {
|
|
66
|
-
let candidate = this.historyService.getLastActiveWorkspaceRoot(schemeFilter);
|
|
65
|
+
async defaultFolderPath(schemeFilter = this.getSchemeFilterForWindow(), authorityFilter = this.getAuthorityFilterForWindow()) {
|
|
66
|
+
let candidate = this.historyService.getLastActiveWorkspaceRoot(schemeFilter, authorityFilter);
|
|
67
67
|
if (!candidate) {
|
|
68
|
-
candidate = this.historyService.getLastActiveFile(schemeFilter);
|
|
68
|
+
candidate = this.historyService.getLastActiveFile(schemeFilter, authorityFilter);
|
|
69
69
|
}
|
|
70
70
|
if (!candidate) {
|
|
71
71
|
return this.preferredHome(schemeFilter);
|
|
@@ -290,6 +290,9 @@ let AbstractFileDialogService = class AbstractFileDialogService {
|
|
|
290
290
|
getSchemeFilterForWindow(defaultUriScheme) {
|
|
291
291
|
return defaultUriScheme ?? this.pathService.defaultUriScheme;
|
|
292
292
|
}
|
|
293
|
+
getAuthorityFilterForWindow() {
|
|
294
|
+
return this.environmentService.remoteAuthority;
|
|
295
|
+
}
|
|
293
296
|
getFileSystemSchema(options) {
|
|
294
297
|
return options.availableFileSystems && options.availableFileSystems[0] || this.getSchemeFilterForWindow(options.defaultUri?.scheme);
|
|
295
298
|
}
|
|
@@ -27,6 +27,7 @@ import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/commo
|
|
|
27
27
|
import { normalizeDriveLetter } from 'monaco-editor/esm/vs/base/common/labels.js';
|
|
28
28
|
import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService';
|
|
29
29
|
import { IAccessibilityService } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js';
|
|
30
|
+
import { getActiveDocument } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
30
31
|
import { IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
31
32
|
|
|
32
33
|
var OpenLocalFileCommand;
|
|
@@ -639,7 +640,7 @@ let SimpleFileDialog = class SimpleFileDialog {
|
|
|
639
640
|
this.autoCompletePathSegment = '';
|
|
640
641
|
this.activeItem = quickPickItem;
|
|
641
642
|
if (force) {
|
|
642
|
-
|
|
643
|
+
getActiveDocument().execCommand('insertText', false, '');
|
|
643
644
|
}
|
|
644
645
|
return false;
|
|
645
646
|
}
|
|
@@ -676,7 +677,7 @@ let SimpleFileDialog = class SimpleFileDialog {
|
|
|
676
677
|
}
|
|
677
678
|
insertText(wholeValue, insertText) {
|
|
678
679
|
if (this.filePickBox.inputHasFocus()) {
|
|
679
|
-
|
|
680
|
+
getActiveDocument().execCommand('insertText', false, insertText);
|
|
680
681
|
if (this.filePickBox.value !== wholeValue) {
|
|
681
682
|
this.filePickBox.value = wholeValue;
|
|
682
683
|
this.handleValueChange(wholeValue);
|
|
@@ -34,7 +34,11 @@ let DialogService = class DialogService extends Disposable {
|
|
|
34
34
|
throw new Error(`DialogService: refused to show dialog in tests. Contents: ${prompt.message}`);
|
|
35
35
|
}
|
|
36
36
|
const handle = this.model.show({ promptArgs: { prompt } });
|
|
37
|
-
|
|
37
|
+
const dialogResult = await handle.result;
|
|
38
|
+
return {
|
|
39
|
+
result: await dialogResult.result,
|
|
40
|
+
checkboxChecked: dialogResult.checkboxChecked
|
|
41
|
+
};
|
|
38
42
|
}
|
|
39
43
|
async input(input) {
|
|
40
44
|
if (this.skipDialogs()) {
|