@codingame/monaco-vscode-dialogs-service-override 14.0.6 → 15.0.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 +5 -5
- package/vscode/src/vs/workbench/browser/parts/dialogs/dialog.web.contribution.d.ts +2 -1
- package/vscode/src/vs/workbench/browser/parts/dialogs/dialog.web.contribution.js +6 -3
- package/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.d.ts +4 -2
- package/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.js +16 -9
- package/vscode/src/vs/workbench/common/dialogs.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/welcomeDialog/browser/welcomeDialog.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/welcomeDialog/browser/welcomeWidget.js +1 -1
- package/vscode/src/vs/workbench/services/dialogs/browser/abstractFileDialogService.d.ts +3 -3
- package/vscode/src/vs/workbench/services/dialogs/browser/abstractFileDialogService.js +18 -18
- package/vscode/src/vs/workbench/services/dialogs/browser/fileDialogService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/dialogs/browser/fileDialogService.js +8 -8
- package/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.d.ts +10 -4
- package/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.js +62 -26
- package/vscode/src/vs/workbench/services/dialogs/common/dialogService.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-dialogs-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - dialogs service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-
|
|
19
|
-
"@codingame/monaco-vscode-
|
|
20
|
-
"@codingame/monaco-vscode-
|
|
21
|
-
"@codingame/monaco-vscode-
|
|
18
|
+
"@codingame/monaco-vscode-2e69e120-617a-5258-95e0-3b8902f4e014-common": "15.0.0",
|
|
19
|
+
"@codingame/monaco-vscode-411e0589-fa79-504b-b32c-80a88847b23a-common": "15.0.0",
|
|
20
|
+
"@codingame/monaco-vscode-44b92f80-48ea-5562-a8d0-18a015f8d845-common": "15.0.0",
|
|
21
|
+
"@codingame/monaco-vscode-api": "15.0.0"
|
|
22
22
|
},
|
|
23
23
|
"main": "index.js",
|
|
24
24
|
"module": "index.js",
|
|
@@ -7,12 +7,13 @@ import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform
|
|
|
7
7
|
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
8
8
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
9
9
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
10
|
+
import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service";
|
|
10
11
|
export declare class DialogHandlerContribution extends Disposable implements IWorkbenchContribution {
|
|
11
12
|
private dialogService;
|
|
12
13
|
static readonly ID = "workbench.contrib.dialogHandler";
|
|
13
14
|
private readonly model;
|
|
14
15
|
private readonly impl;
|
|
15
16
|
private currentDialog;
|
|
16
|
-
constructor(dialogService: IDialogService, logService: ILogService, layoutService: ILayoutService, keybindingService: IKeybindingService, instantiationService: IInstantiationService, productService: IProductService, clipboardService: IClipboardService);
|
|
17
|
+
constructor(dialogService: IDialogService, logService: ILogService, layoutService: ILayoutService, keybindingService: IKeybindingService, instantiationService: IInstantiationService, productService: IProductService, clipboardService: IClipboardService, openerService: IOpenerService);
|
|
17
18
|
private processDialogs;
|
|
18
19
|
}
|
|
@@ -11,10 +11,11 @@ import { BrowserDialogHandler } from './dialogHandler.js';
|
|
|
11
11
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
12
12
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
13
13
|
import { Lazy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lazy';
|
|
14
|
+
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
14
15
|
|
|
15
16
|
let DialogHandlerContribution = class DialogHandlerContribution extends Disposable {
|
|
16
17
|
static { this.ID = 'workbench.contrib.dialogHandler'; }
|
|
17
|
-
constructor(dialogService, logService, layoutService, keybindingService, instantiationService, productService, clipboardService) {
|
|
18
|
+
constructor(dialogService, logService, layoutService, keybindingService, instantiationService, productService, clipboardService, openerService) {
|
|
18
19
|
super();
|
|
19
20
|
this.dialogService = dialogService;
|
|
20
21
|
this.impl = ( new Lazy(() => ( new BrowserDialogHandler(
|
|
@@ -23,7 +24,8 @@ let DialogHandlerContribution = class DialogHandlerContribution extends Disposab
|
|
|
23
24
|
keybindingService,
|
|
24
25
|
instantiationService,
|
|
25
26
|
productService,
|
|
26
|
-
clipboardService
|
|
27
|
+
clipboardService,
|
|
28
|
+
openerService
|
|
27
29
|
))));
|
|
28
30
|
this.model = this.dialogService.model;
|
|
29
31
|
this._register(this.model.onWillShowDialog(() => {
|
|
@@ -69,7 +71,8 @@ DialogHandlerContribution = ( __decorate([
|
|
|
69
71
|
( __param(3, IKeybindingService)),
|
|
70
72
|
( __param(4, IInstantiationService)),
|
|
71
73
|
( __param(5, IProductService)),
|
|
72
|
-
( __param(6, IClipboardService))
|
|
74
|
+
( __param(6, IClipboardService)),
|
|
75
|
+
( __param(7, IOpenerService))
|
|
73
76
|
], DialogHandlerContribution));
|
|
74
77
|
registerWorkbenchContribution2(DialogHandlerContribution.ID, DialogHandlerContribution, WorkbenchPhase.BlockStartup
|
|
75
78
|
);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { IConfirmation, IConfirmationResult, IInputResult, IInput, AbstractDialogHandler, IPrompt, IAsyncPromptResult } from "@codingame/monaco-vscode-
|
|
1
|
+
import { IConfirmation, IConfirmationResult, IInputResult, IInput, AbstractDialogHandler, IPrompt, IAsyncPromptResult } from "@codingame/monaco-vscode-2e69e120-617a-5258-95e0-3b8902f4e014-common/vscode/vs/platform/dialogs/common/dialogs";
|
|
2
2
|
import { ILayoutService } from "@codingame/monaco-vscode-api/vscode/vs/platform/layout/browser/layoutService.service";
|
|
3
3
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
4
4
|
import { IKeybindingService } from "@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service";
|
|
5
5
|
import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
|
|
6
6
|
import { IClipboardService } from "@codingame/monaco-vscode-api/vscode/vs/platform/clipboard/common/clipboardService.service";
|
|
7
7
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
8
|
+
import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service";
|
|
8
9
|
export declare class BrowserDialogHandler extends AbstractDialogHandler {
|
|
9
10
|
private readonly logService;
|
|
10
11
|
private readonly layoutService;
|
|
@@ -12,9 +13,10 @@ export declare class BrowserDialogHandler extends AbstractDialogHandler {
|
|
|
12
13
|
private readonly instantiationService;
|
|
13
14
|
private readonly productService;
|
|
14
15
|
private readonly clipboardService;
|
|
16
|
+
private readonly openerService;
|
|
15
17
|
private static readonly ALLOWABLE_COMMANDS;
|
|
16
18
|
private readonly markdownRenderer;
|
|
17
|
-
constructor(logService: ILogService, layoutService: ILayoutService, keybindingService: IKeybindingService, instantiationService: IInstantiationService, productService: IProductService, clipboardService: IClipboardService);
|
|
19
|
+
constructor(logService: ILogService, layoutService: ILayoutService, keybindingService: IKeybindingService, instantiationService: IInstantiationService, productService: IProductService, clipboardService: IClipboardService, openerService: IOpenerService);
|
|
18
20
|
prompt<T>(prompt: IPrompt<T>): Promise<IAsyncPromptResult<T>>;
|
|
19
21
|
confirm(confirmation: IConfirmation): Promise<IConfirmationResult>;
|
|
20
22
|
input(input: IInput): Promise<IInputResult>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
4
|
-
import { AbstractDialogHandler } from '@codingame/monaco-vscode-
|
|
4
|
+
import { AbstractDialogHandler } from '@codingame/monaco-vscode-2e69e120-617a-5258-95e0-3b8902f4e014-common/vscode/vs/platform/dialogs/common/dialogs';
|
|
5
5
|
import { ILayoutService } from '@codingame/monaco-vscode-api/vscode/vs/platform/layout/browser/layoutService.service';
|
|
6
6
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
7
7
|
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
@@ -13,9 +13,10 @@ import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform
|
|
|
13
13
|
import { IClipboardService } from '@codingame/monaco-vscode-api/vscode/vs/platform/clipboard/common/clipboardService.service';
|
|
14
14
|
import { fromNow } from '@codingame/monaco-vscode-api/vscode/vs/base/common/date';
|
|
15
15
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
16
|
-
import { MarkdownRenderer } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer';
|
|
16
|
+
import { MarkdownRenderer, openLinkFromMarkdown } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer';
|
|
17
17
|
import { defaultDialogStyles, defaultInputBoxStyles, defaultCheckboxStyles, defaultButtonStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
|
|
18
18
|
import { ResultKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingResolver';
|
|
19
|
+
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
19
20
|
|
|
20
21
|
var BrowserDialogHandler_1;
|
|
21
22
|
let BrowserDialogHandler = class BrowserDialogHandler extends AbstractDialogHandler {
|
|
@@ -28,7 +29,7 @@ let BrowserDialogHandler = class BrowserDialogHandler extends AbstractDialogHand
|
|
|
28
29
|
'editor.action.clipboardCutAction',
|
|
29
30
|
'editor.action.clipboardPasteAction'
|
|
30
31
|
]; }
|
|
31
|
-
constructor(logService, layoutService, keybindingService, instantiationService, productService, clipboardService) {
|
|
32
|
+
constructor(logService, layoutService, keybindingService, instantiationService, productService, clipboardService, openerService) {
|
|
32
33
|
super();
|
|
33
34
|
this.logService = logService;
|
|
34
35
|
this.layoutService = layoutService;
|
|
@@ -36,6 +37,7 @@ let BrowserDialogHandler = class BrowserDialogHandler extends AbstractDialogHand
|
|
|
36
37
|
this.instantiationService = instantiationService;
|
|
37
38
|
this.productService = productService;
|
|
38
39
|
this.clipboardService = clipboardService;
|
|
40
|
+
this.openerService = openerService;
|
|
39
41
|
this.markdownRenderer = this.instantiationService.createInstance(MarkdownRenderer, {});
|
|
40
42
|
}
|
|
41
43
|
async prompt(prompt) {
|
|
@@ -59,7 +61,7 @@ let BrowserDialogHandler = class BrowserDialogHandler extends AbstractDialogHand
|
|
|
59
61
|
async about() {
|
|
60
62
|
const detailString = (useAgo) => {
|
|
61
63
|
return localize(
|
|
62
|
-
|
|
64
|
+
2803,
|
|
63
65
|
"Version: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}",
|
|
64
66
|
this.productService.version || 'Unknown',
|
|
65
67
|
this.productService.commit || 'Unknown',
|
|
@@ -70,8 +72,8 @@ let BrowserDialogHandler = class BrowserDialogHandler extends AbstractDialogHand
|
|
|
70
72
|
const detail = detailString(true);
|
|
71
73
|
const detailToCopy = detailString(false);
|
|
72
74
|
const { button } = await this.doShow(Severity.Info, this.productService.nameLong, [
|
|
73
|
-
( localize(
|
|
74
|
-
( localize(
|
|
75
|
+
( localize(2804, "&&Copy")),
|
|
76
|
+
( localize(2805, "OK"))
|
|
75
77
|
], detail, 1);
|
|
76
78
|
if (button === 0) {
|
|
77
79
|
this.clipboardService.writeText(detailToCopy);
|
|
@@ -82,7 +84,12 @@ let BrowserDialogHandler = class BrowserDialogHandler extends AbstractDialogHand
|
|
|
82
84
|
const renderBody = customOptions ? (parent) => {
|
|
83
85
|
parent.classList.add(...(customOptions.classes || []));
|
|
84
86
|
customOptions.markdownDetails?.forEach(markdownDetail => {
|
|
85
|
-
const result = this.markdownRenderer.render(markdownDetail.markdown
|
|
87
|
+
const result = this.markdownRenderer.render(markdownDetail.markdown, {
|
|
88
|
+
actionHandler: {
|
|
89
|
+
callback: link => openLinkFromMarkdown(this.openerService, link, markdownDetail.markdown.isTrusted, true ),
|
|
90
|
+
disposables: dialogDisposables
|
|
91
|
+
}
|
|
92
|
+
});
|
|
86
93
|
parent.appendChild(result.element);
|
|
87
94
|
result.element.classList.add(...(markdownDetail.classes || []));
|
|
88
95
|
dialogDisposables.add(result);
|
|
@@ -103,7 +110,6 @@ let BrowserDialogHandler = class BrowserDialogHandler extends AbstractDialogHand
|
|
|
103
110
|
renderBody,
|
|
104
111
|
icon: customOptions?.icon,
|
|
105
112
|
disableCloseAction: customOptions?.disableCloseAction,
|
|
106
|
-
closeOnLinkClick: customOptions?.closeOnLinkClick,
|
|
107
113
|
buttonDetails: customOptions?.buttonDetails,
|
|
108
114
|
checkboxLabel: checkbox?.label,
|
|
109
115
|
checkboxChecked: checkbox?.checked,
|
|
@@ -125,7 +131,8 @@ BrowserDialogHandler = BrowserDialogHandler_1 = ( __decorate([
|
|
|
125
131
|
( __param(2, IKeybindingService)),
|
|
126
132
|
( __param(3, IInstantiationService)),
|
|
127
133
|
( __param(4, IProductService)),
|
|
128
|
-
( __param(5, IClipboardService))
|
|
134
|
+
( __param(5, IClipboardService)),
|
|
135
|
+
( __param(6, IOpenerService))
|
|
129
136
|
], BrowserDialogHandler));
|
|
130
137
|
|
|
131
138
|
export { BrowserDialogHandler };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
2
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
-
import { IDialogArgs, IDialogResult } from "@codingame/monaco-vscode-
|
|
3
|
+
import { IDialogArgs, IDialogResult } from "@codingame/monaco-vscode-2e69e120-617a-5258-95e0-3b8902f4e014-common/vscode/vs/platform/dialogs/common/dialogs";
|
|
4
4
|
export interface IDialogViewItem {
|
|
5
5
|
readonly args: IDialogArgs;
|
|
6
6
|
close(result?: IDialogResult | Error): void;
|
|
@@ -10,7 +10,7 @@ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
10
10
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
11
11
|
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
12
12
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
13
|
-
import { ICodeEditorService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService';
|
|
13
|
+
import { ICodeEditorService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService.service';
|
|
14
14
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
15
15
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
16
16
|
import { WelcomeWidget } from './welcomeWidget.js';
|
|
@@ -90,7 +90,7 @@ configurationRegistry.registerConfiguration({
|
|
|
90
90
|
type: 'boolean',
|
|
91
91
|
default: false,
|
|
92
92
|
tags: ['experimental'],
|
|
93
|
-
description: ( localize(
|
|
93
|
+
description: ( localize(11039, "When enabled, a welcome widget is shown in the editor"))
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
});
|
|
@@ -72,7 +72,7 @@ class WelcomeWidget extends Disposable {
|
|
|
72
72
|
}
|
|
73
73
|
async buildWidgetContent(title, message, buttonText, buttonAction) {
|
|
74
74
|
const actionBar = this._register(( new ActionBar(this.element, {})));
|
|
75
|
-
const action = this._register(( new Action('dialog.close', ( localize(
|
|
75
|
+
const action = this._register(( new Action('dialog.close', ( localize(11040, "Close Dialog")), ThemeIcon.asClassName(Codicon.dialogClose), true, async () => {
|
|
76
76
|
this._hide();
|
|
77
77
|
})));
|
|
78
78
|
actionBar.push(action, { icon: true, label: false });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPickAndOpenOptions, ISaveDialogOptions, IOpenDialogOptions, ConfirmResult } from "@codingame/monaco-vscode-
|
|
1
|
+
import { IPickAndOpenOptions, ISaveDialogOptions, IOpenDialogOptions, ConfirmResult } from "@codingame/monaco-vscode-2e69e120-617a-5258-95e0-3b8902f4e014-common/vscode/vs/platform/dialogs/common/dialogs";
|
|
2
2
|
import { IFileDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service";
|
|
3
3
|
import { IDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service";
|
|
4
4
|
import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
|
|
@@ -12,11 +12,11 @@ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
12
12
|
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
13
13
|
import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service";
|
|
14
14
|
import { IHostService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service";
|
|
15
|
-
import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language";
|
|
15
|
+
import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
|
|
16
16
|
import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
|
|
17
17
|
import { IPathService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service";
|
|
18
18
|
import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
|
|
19
|
-
import { ICodeEditorService } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService";
|
|
19
|
+
import { ICodeEditorService } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService.service";
|
|
20
20
|
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
21
21
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
22
22
|
export declare abstract class AbstractFileDialogService implements IFileDialogService {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
4
4
|
import { isWorkspaceToOpen, isFileToOpen } from '@codingame/monaco-vscode-api/vscode/vs/platform/window/common/window';
|
|
5
|
-
import { ConfirmResult, getFileNamesMessage } from '@codingame/monaco-vscode-
|
|
5
|
+
import { ConfirmResult, getFileNamesMessage } from '@codingame/monaco-vscode-2e69e120-617a-5258-95e0-3b8902f4e014-common/vscode/vs/platform/dialogs/common/dialogs';
|
|
6
6
|
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
7
7
|
import { WorkbenchState, isSavedWorkspace, isTemporaryWorkspace, WORKSPACE_EXTENSION } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace';
|
|
8
8
|
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
@@ -20,13 +20,13 @@ import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/s
|
|
|
20
20
|
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
21
21
|
import { coalesce, distinct } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
22
22
|
import { trim } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
23
|
-
import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language';
|
|
23
|
+
import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
|
|
24
24
|
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
25
25
|
import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service';
|
|
26
26
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
27
27
|
import { PLAINTEXT_EXTENSION } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/modesRegistry';
|
|
28
28
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
29
|
-
import { ICodeEditorService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService';
|
|
29
|
+
import { ICodeEditorService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService.service';
|
|
30
30
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
31
31
|
import { EditorOpenSource } from '@codingame/monaco-vscode-api/vscode/vs/platform/editor/common/editor';
|
|
32
32
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
@@ -121,17 +121,17 @@ let AbstractFileDialogService = class AbstractFileDialogService {
|
|
|
121
121
|
return ConfirmResult.DONT_SAVE;
|
|
122
122
|
}
|
|
123
123
|
let message;
|
|
124
|
-
let detail = ( localize(
|
|
124
|
+
let detail = ( localize(11666, "Your changes will be lost if you don't save them."));
|
|
125
125
|
if (fileNamesOrResources.length === 1) {
|
|
126
126
|
message = ( localize(
|
|
127
|
-
|
|
127
|
+
11667,
|
|
128
128
|
"Do you want to save the changes you made to {0}?",
|
|
129
129
|
typeof fileNamesOrResources[0] === 'string' ? fileNamesOrResources[0] : basename(fileNamesOrResources[0])
|
|
130
130
|
));
|
|
131
131
|
}
|
|
132
132
|
else {
|
|
133
133
|
message = ( localize(
|
|
134
|
-
|
|
134
|
+
11668,
|
|
135
135
|
"Do you want to save the changes to the following {0} files?",
|
|
136
136
|
fileNamesOrResources.length
|
|
137
137
|
));
|
|
@@ -144,12 +144,12 @@ let AbstractFileDialogService = class AbstractFileDialogService {
|
|
|
144
144
|
buttons: [
|
|
145
145
|
{
|
|
146
146
|
label: fileNamesOrResources.length > 1 ?
|
|
147
|
-
( localize(
|
|
148
|
-
( localize(
|
|
147
|
+
( localize(11669, "&&Save All")) :
|
|
148
|
+
( localize(11670, "&&Save")),
|
|
149
149
|
run: () => ConfirmResult.SAVE
|
|
150
150
|
},
|
|
151
151
|
{
|
|
152
|
-
label: ( localize(
|
|
152
|
+
label: ( localize(11671, "Do&&n't Save")),
|
|
153
153
|
run: () => ConfirmResult.DONT_SAVE
|
|
154
154
|
}
|
|
155
155
|
],
|
|
@@ -163,7 +163,7 @@ let AbstractFileDialogService = class AbstractFileDialogService {
|
|
|
163
163
|
return schema === Schemas.untitled ? [Schemas.file] : (schema !== Schemas.file ? [schema, Schemas.file] : [schema]);
|
|
164
164
|
}
|
|
165
165
|
async pickFileFolderAndOpenSimplified(schema, options, preferNewWindow) {
|
|
166
|
-
const title = ( localize(
|
|
166
|
+
const title = ( localize(11672, 'Open File or Folder'));
|
|
167
167
|
const availableFileSystems = this.addFileSchemaIfNeeded(schema);
|
|
168
168
|
const uri = await this.pickResource({ canSelectFiles: true, canSelectFolders: true, canSelectMany: false, defaultUri: options.defaultUri, title, availableFileSystems });
|
|
169
169
|
if (uri) {
|
|
@@ -181,7 +181,7 @@ let AbstractFileDialogService = class AbstractFileDialogService {
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
async pickFileAndOpenSimplified(schema, options, preferNewWindow) {
|
|
184
|
-
const title = ( localize(
|
|
184
|
+
const title = ( localize(11673, 'Open File'));
|
|
185
185
|
const availableFileSystems = this.addFileSchemaIfNeeded(schema);
|
|
186
186
|
const uri = await this.pickResource({ canSelectFiles: true, canSelectFolders: false, canSelectMany: false, defaultUri: options.defaultUri, title, availableFileSystems });
|
|
187
187
|
if (uri) {
|
|
@@ -198,7 +198,7 @@ let AbstractFileDialogService = class AbstractFileDialogService {
|
|
|
198
198
|
this.workspacesService.addRecentlyOpened([{ fileUri: uri, label: this.labelService.getUriLabel(uri, { appendWorkspaceSuffix: true }) }]);
|
|
199
199
|
}
|
|
200
200
|
async pickFolderAndOpenSimplified(schema, options) {
|
|
201
|
-
const title = ( localize(
|
|
201
|
+
const title = ( localize(11674, 'Open Folder'));
|
|
202
202
|
const availableFileSystems = this.addFileSchemaIfNeeded(schema, true);
|
|
203
203
|
const uri = await this.pickResource({ canSelectFiles: false, canSelectFolders: true, canSelectMany: false, defaultUri: options.defaultUri, title, availableFileSystems });
|
|
204
204
|
if (uri) {
|
|
@@ -206,8 +206,8 @@ let AbstractFileDialogService = class AbstractFileDialogService {
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
async pickWorkspaceAndOpenSimplified(schema, options) {
|
|
209
|
-
const title = ( localize(
|
|
210
|
-
const filters = [{ name: ( localize(
|
|
209
|
+
const title = ( localize(11675, 'Open Workspace from File'));
|
|
210
|
+
const filters = [{ name: ( localize(11676, 'Workspace')), extensions: [WORKSPACE_EXTENSION] }];
|
|
211
211
|
const availableFileSystems = this.addFileSchemaIfNeeded(schema, true);
|
|
212
212
|
const uri = await this.pickResource({ canSelectFiles: true, canSelectFolders: false, canSelectMany: false, defaultUri: options.defaultUri, title, filters, availableFileSystems });
|
|
213
213
|
if (uri) {
|
|
@@ -218,7 +218,7 @@ let AbstractFileDialogService = class AbstractFileDialogService {
|
|
|
218
218
|
if (!options.availableFileSystems) {
|
|
219
219
|
options.availableFileSystems = this.addFileSchemaIfNeeded(schema);
|
|
220
220
|
}
|
|
221
|
-
options.title = ( localize(
|
|
221
|
+
options.title = ( localize(11677, 'Save As'));
|
|
222
222
|
const uri = await this.saveRemoteResource(options);
|
|
223
223
|
if (uri) {
|
|
224
224
|
this.addFileToRecentlyOpened(uri);
|
|
@@ -269,7 +269,7 @@ let AbstractFileDialogService = class AbstractFileDialogService {
|
|
|
269
269
|
getPickFileToSaveDialogOptions(defaultUri, availableFileSystems) {
|
|
270
270
|
const options = {
|
|
271
271
|
defaultUri,
|
|
272
|
-
title: ( localize(
|
|
272
|
+
title: ( localize(11678, "Save As")),
|
|
273
273
|
availableFileSystems
|
|
274
274
|
};
|
|
275
275
|
const ext = defaultUri ? extname(defaultUri) : undefined;
|
|
@@ -296,10 +296,10 @@ let AbstractFileDialogService = class AbstractFileDialogService {
|
|
|
296
296
|
matchingFilter = { name: trim(ext, '.').toUpperCase(), extensions: [trim(ext, '.')] };
|
|
297
297
|
}
|
|
298
298
|
options.filters = coalesce([
|
|
299
|
-
{ name: ( localize(
|
|
299
|
+
{ name: ( localize(11679, "All Files")), extensions: ['*'] },
|
|
300
300
|
matchingFilter,
|
|
301
301
|
...registeredLanguageFilters,
|
|
302
|
-
{ name: ( localize(
|
|
302
|
+
{ name: ( localize(11680, "No Extension")), extensions: [''] }
|
|
303
303
|
]);
|
|
304
304
|
return options;
|
|
305
305
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPickAndOpenOptions, ISaveDialogOptions, IOpenDialogOptions } from "@codingame/monaco-vscode-
|
|
1
|
+
import { IPickAndOpenOptions, ISaveDialogOptions, IOpenDialogOptions } from "@codingame/monaco-vscode-2e69e120-617a-5258-95e0-3b8902f4e014-common/vscode/vs/platform/dialogs/common/dialogs";
|
|
2
2
|
import { IFileDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service";
|
|
3
3
|
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
4
|
import { AbstractFileDialogService } from "./abstractFileDialogService.js";
|
|
@@ -28,7 +28,7 @@ class FileDialogService extends AbstractFileDialogService {
|
|
|
28
28
|
if (this.shouldUseSimplified(schema)) {
|
|
29
29
|
return super.pickFileFolderAndOpenSimplified(schema, options, false);
|
|
30
30
|
}
|
|
31
|
-
throw ( new Error(( localize(
|
|
31
|
+
throw ( new Error(( localize(11681, "Can't open folders, try adding a folder to the workspace instead."))));
|
|
32
32
|
}
|
|
33
33
|
addFileSchemaIfNeeded(schema, isFolder) {
|
|
34
34
|
return (schema === Schemas.untitled) ? [Schemas.file]
|
|
@@ -68,7 +68,7 @@ class FileDialogService extends AbstractFileDialogService {
|
|
|
68
68
|
if (this.shouldUseSimplified(schema)) {
|
|
69
69
|
return super.pickFolderAndOpenSimplified(schema, options);
|
|
70
70
|
}
|
|
71
|
-
throw ( new Error(( localize(
|
|
71
|
+
throw ( new Error(( localize(11681, "Can't open folders, try adding a folder to the workspace instead."))));
|
|
72
72
|
}
|
|
73
73
|
async pickWorkspaceAndOpen(options) {
|
|
74
74
|
options.availableFileSystems = this.getWorkspaceAvailableFileSystems(options);
|
|
@@ -80,7 +80,7 @@ class FileDialogService extends AbstractFileDialogService {
|
|
|
80
80
|
return super.pickWorkspaceAndOpenSimplified(schema, options);
|
|
81
81
|
}
|
|
82
82
|
throw ( new Error(( localize(
|
|
83
|
-
|
|
83
|
+
11682,
|
|
84
84
|
"Can't open workspaces, try adding a folder to the workspace instead."
|
|
85
85
|
))));
|
|
86
86
|
}
|
|
@@ -182,17 +182,17 @@ class FileDialogService extends AbstractFileDialogService {
|
|
|
182
182
|
}
|
|
183
183
|
const buttons = [
|
|
184
184
|
{
|
|
185
|
-
label: ( localize(
|
|
185
|
+
label: ( localize(11683, "&&Open Remote...")),
|
|
186
186
|
run: async () => { await this.commandService.executeCommand('workbench.action.remote.showMenu'); }
|
|
187
187
|
},
|
|
188
188
|
{
|
|
189
|
-
label: ( localize(
|
|
189
|
+
label: ( localize(11684, "&&Learn More")),
|
|
190
190
|
run: async () => { await this.openerService.open('https://aka.ms/VSCodeWebLocalFileSystemAccess'); }
|
|
191
191
|
}
|
|
192
192
|
];
|
|
193
193
|
if (context === 'open') {
|
|
194
194
|
buttons.push({
|
|
195
|
-
label: ( localize(
|
|
195
|
+
label: ( localize(11685, "Open &&Files...")),
|
|
196
196
|
run: async () => {
|
|
197
197
|
const files = await triggerUpload();
|
|
198
198
|
if (files) {
|
|
@@ -212,9 +212,9 @@ class FileDialogService extends AbstractFileDialogService {
|
|
|
212
212
|
}
|
|
213
213
|
await this.dialogService.prompt({
|
|
214
214
|
type: Severity.Warning,
|
|
215
|
-
message: ( localize(
|
|
215
|
+
message: ( localize(11686, "Opening Local Folders is Unsupported")),
|
|
216
216
|
detail: ( localize(
|
|
217
|
-
|
|
217
|
+
11687,
|
|
218
218
|
"Your browser doesn't support opening local folders.\nYou can either open single files or open a remote repository."
|
|
219
219
|
)),
|
|
220
220
|
buttons
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
2
2
|
import { IQuickInputService } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service";
|
|
3
3
|
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
|
-
import { ISaveDialogOptions, IOpenDialogOptions } from "@codingame/monaco-vscode-
|
|
4
|
+
import { ISaveDialogOptions, IOpenDialogOptions } from "@codingame/monaco-vscode-2e69e120-617a-5258-95e0-3b8902f4e014-common/vscode/vs/platform/dialogs/common/dialogs";
|
|
5
5
|
import { IFileDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service";
|
|
6
6
|
import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
|
|
7
7
|
import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
|
|
8
8
|
import { INotificationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service";
|
|
9
|
-
import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model";
|
|
10
|
-
import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language";
|
|
9
|
+
import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service";
|
|
10
|
+
import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
|
|
11
11
|
import { IWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service";
|
|
12
12
|
import { IRemoteAgentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/remote/common/remoteAgentService.service";
|
|
13
13
|
import { RawContextKey } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey";
|
|
@@ -17,6 +17,7 @@ import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/
|
|
|
17
17
|
import { ICommandHandler } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands";
|
|
18
18
|
import { IPathService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service";
|
|
19
19
|
import { IAccessibilityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service";
|
|
20
|
+
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
20
21
|
export declare namespace OpenLocalFileCommand {
|
|
21
22
|
const ID = "workbench.action.files.openLocalFile";
|
|
22
23
|
const LABEL: string;
|
|
@@ -56,6 +57,7 @@ export declare class SimpleFileDialog extends Disposable implements ISimpleFileD
|
|
|
56
57
|
protected readonly pathService: IPathService;
|
|
57
58
|
private readonly keybindingService;
|
|
58
59
|
private readonly accessibilityService;
|
|
60
|
+
private readonly storageService;
|
|
59
61
|
private options;
|
|
60
62
|
private currentFolder;
|
|
61
63
|
private filePickBox;
|
|
@@ -78,7 +80,10 @@ export declare class SimpleFileDialog extends Disposable implements ISimpleFileD
|
|
|
78
80
|
private separator;
|
|
79
81
|
private readonly onBusyChangeEmitter;
|
|
80
82
|
private updatingPromise;
|
|
81
|
-
|
|
83
|
+
private _showDotFiles;
|
|
84
|
+
constructor(fileService: IFileService, quickInputService: IQuickInputService, labelService: ILabelService, workspaceContextService: IWorkspaceContextService, notificationService: INotificationService, fileDialogService: IFileDialogService, modelService: IModelService, languageService: ILanguageService, environmentService: IWorkbenchEnvironmentService, remoteAgentService: IRemoteAgentService, pathService: IPathService, keybindingService: IKeybindingService, contextKeyService: IContextKeyService, accessibilityService: IAccessibilityService, storageService: IStorageService);
|
|
85
|
+
private setShowDotFiles;
|
|
86
|
+
private getShowDotFiles;
|
|
82
87
|
set busy(busy: boolean);
|
|
83
88
|
get busy(): boolean;
|
|
84
89
|
showOpenDialog(options?: IOpenDialogOptions): Promise<URI | undefined>;
|
|
@@ -91,6 +96,7 @@ export declare class SimpleFileDialog extends Disposable implements ISimpleFileD
|
|
|
91
96
|
private pickResource;
|
|
92
97
|
dispose(): void;
|
|
93
98
|
private handleValueChange;
|
|
99
|
+
private setButtons;
|
|
94
100
|
private isBadSubpath;
|
|
95
101
|
private isValueChangeFromUser;
|
|
96
102
|
private isSelectionChangeFromUser;
|
|
@@ -13,8 +13,8 @@ import { IFileDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
13
13
|
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
14
14
|
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
15
15
|
import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
|
|
16
|
-
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model';
|
|
17
|
-
import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language';
|
|
16
|
+
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
|
|
17
|
+
import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
|
|
18
18
|
import { getIconClasses } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/getIconClasses';
|
|
19
19
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
20
20
|
import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
@@ -33,11 +33,15 @@ import { SaveReason } from '@codingame/monaco-vscode-api/vscode/vs/workbench/com
|
|
|
33
33
|
import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service';
|
|
34
34
|
import { IAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
35
35
|
import { getActiveDocument } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
36
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
37
|
+
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
38
|
+
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
39
|
+
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
36
40
|
|
|
37
41
|
var OpenLocalFileCommand;
|
|
38
42
|
(function (OpenLocalFileCommand) {
|
|
39
43
|
OpenLocalFileCommand.ID = 'workbench.action.files.openLocalFile';
|
|
40
|
-
OpenLocalFileCommand.LABEL = ( localize(
|
|
44
|
+
OpenLocalFileCommand.LABEL = ( localize(11688, "Open Local File..."));
|
|
41
45
|
function handler() {
|
|
42
46
|
return accessor => {
|
|
43
47
|
const dialogService = accessor.get(IFileDialogService);
|
|
@@ -49,7 +53,7 @@ var OpenLocalFileCommand;
|
|
|
49
53
|
var SaveLocalFileCommand;
|
|
50
54
|
(function (SaveLocalFileCommand) {
|
|
51
55
|
SaveLocalFileCommand.ID = 'workbench.action.files.saveLocalFile';
|
|
52
|
-
SaveLocalFileCommand.LABEL = ( localize(
|
|
56
|
+
SaveLocalFileCommand.LABEL = ( localize(11689, "Save Local File..."));
|
|
53
57
|
function handler() {
|
|
54
58
|
return accessor => {
|
|
55
59
|
const editorService = accessor.get(IEditorService);
|
|
@@ -65,7 +69,7 @@ var SaveLocalFileCommand;
|
|
|
65
69
|
var OpenLocalFolderCommand;
|
|
66
70
|
(function (OpenLocalFolderCommand) {
|
|
67
71
|
OpenLocalFolderCommand.ID = 'workbench.action.files.openLocalFolder';
|
|
68
|
-
OpenLocalFolderCommand.LABEL = ( localize(
|
|
72
|
+
OpenLocalFolderCommand.LABEL = ( localize(11690, "Open Local Folder..."));
|
|
69
73
|
function handler() {
|
|
70
74
|
return accessor => {
|
|
71
75
|
const dialogService = accessor.get(IFileDialogService);
|
|
@@ -77,7 +81,7 @@ var OpenLocalFolderCommand;
|
|
|
77
81
|
var OpenLocalFileFolderCommand;
|
|
78
82
|
(function (OpenLocalFileFolderCommand) {
|
|
79
83
|
OpenLocalFileFolderCommand.ID = 'workbench.action.files.openLocalFileFolder';
|
|
80
|
-
OpenLocalFileFolderCommand.LABEL = ( localize(
|
|
84
|
+
OpenLocalFileFolderCommand.LABEL = ( localize(11691, "Open Local..."));
|
|
81
85
|
function handler() {
|
|
82
86
|
return accessor => {
|
|
83
87
|
const dialogService = accessor.get(IFileDialogService);
|
|
@@ -96,7 +100,7 @@ var UpdateResult;
|
|
|
96
100
|
})(UpdateResult || (UpdateResult = {}));
|
|
97
101
|
const RemoteFileDialogContext = ( new RawContextKey('remoteFileDialogVisible', false));
|
|
98
102
|
let SimpleFileDialog = class SimpleFileDialog extends Disposable {
|
|
99
|
-
constructor(fileService, quickInputService, labelService, workspaceContextService, notificationService, fileDialogService, modelService, languageService, environmentService, remoteAgentService, pathService, keybindingService, contextKeyService, accessibilityService) {
|
|
103
|
+
constructor(fileService, quickInputService, labelService, workspaceContextService, notificationService, fileDialogService, modelService, languageService, environmentService, remoteAgentService, pathService, keybindingService, contextKeyService, accessibilityService, storageService) {
|
|
100
104
|
super();
|
|
101
105
|
this.fileService = fileService;
|
|
102
106
|
this.quickInputService = quickInputService;
|
|
@@ -111,6 +115,7 @@ let SimpleFileDialog = class SimpleFileDialog extends Disposable {
|
|
|
111
115
|
this.pathService = pathService;
|
|
112
116
|
this.keybindingService = keybindingService;
|
|
113
117
|
this.accessibilityService = accessibilityService;
|
|
118
|
+
this.storageService = storageService;
|
|
114
119
|
this.hidden = false;
|
|
115
120
|
this.allowFileSelection = true;
|
|
116
121
|
this.allowFolderSelection = false;
|
|
@@ -120,9 +125,27 @@ let SimpleFileDialog = class SimpleFileDialog extends Disposable {
|
|
|
120
125
|
this.isWindows = false;
|
|
121
126
|
this.separator = '/';
|
|
122
127
|
this.onBusyChangeEmitter = this._register(( new Emitter()));
|
|
128
|
+
this._showDotFiles = true;
|
|
123
129
|
this.remoteAuthority = this.environmentService.remoteAuthority;
|
|
124
130
|
this.contextKey = RemoteFileDialogContext.bindTo(contextKeyService);
|
|
125
131
|
this.scheme = this.pathService.defaultUriScheme;
|
|
132
|
+
this.getShowDotFiles();
|
|
133
|
+
const disposableStore = this._register(( new DisposableStore()));
|
|
134
|
+
this.storageService.onDidChangeValue(StorageScope.WORKSPACE, 'remoteFileDialog.showDotFiles', disposableStore)(async (_) => {
|
|
135
|
+
this.getShowDotFiles();
|
|
136
|
+
this.setButtons();
|
|
137
|
+
const startingValue = this.filePickBox.value;
|
|
138
|
+
const folderValue = this.pathFromUri(this.currentFolder, true);
|
|
139
|
+
this.filePickBox.value = folderValue;
|
|
140
|
+
await this.tryUpdateItems(folderValue, this.currentFolder, true);
|
|
141
|
+
this.filePickBox.value = startingValue;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
setShowDotFiles(showDotFiles) {
|
|
145
|
+
this.storageService.store('remoteFileDialog.showDotFiles', showDotFiles, StorageScope.WORKSPACE, StorageTarget.USER);
|
|
146
|
+
}
|
|
147
|
+
getShowDotFiles() {
|
|
148
|
+
this._showDotFiles = this.storageService.getBoolean('remoteFileDialog.showDotFiles', StorageScope.WORKSPACE, true);
|
|
126
149
|
}
|
|
127
150
|
set busy(busy) {
|
|
128
151
|
if (this.filePickBox.busy !== busy) {
|
|
@@ -177,7 +200,7 @@ let SimpleFileDialog = class SimpleFileDialog extends Disposable {
|
|
|
177
200
|
}
|
|
178
201
|
if ((this.scheme !== Schemas.file) && !this.fileService.hasProvider(defaultUri)) {
|
|
179
202
|
this.notificationService.info(( localize(
|
|
180
|
-
|
|
203
|
+
11692,
|
|
181
204
|
'File system provider for {0} is not available.',
|
|
182
205
|
(defaultUri.toString())
|
|
183
206
|
)));
|
|
@@ -251,7 +274,7 @@ let SimpleFileDialog = class SimpleFileDialog extends Disposable {
|
|
|
251
274
|
this.filePickBox.okLabel = typeof this.options.openLabel === 'string' ? this.options.openLabel : this.options.openLabel?.withoutMnemonic;
|
|
252
275
|
if ((this.scheme !== Schemas.file) && this.options && this.options.availableFileSystems && (this.options.availableFileSystems.length > 1) && (this.options.availableFileSystems.indexOf(Schemas.file) > -1)) {
|
|
253
276
|
this.filePickBox.customButton = true;
|
|
254
|
-
this.filePickBox.customLabel = ( localize(
|
|
277
|
+
this.filePickBox.customLabel = ( localize(11693, 'Show Local'));
|
|
255
278
|
let action;
|
|
256
279
|
if (isSave) {
|
|
257
280
|
action = SaveLocalFileCommand;
|
|
@@ -267,6 +290,10 @@ let SimpleFileDialog = class SimpleFileDialog extends Disposable {
|
|
|
267
290
|
}
|
|
268
291
|
}
|
|
269
292
|
}
|
|
293
|
+
this.setButtons();
|
|
294
|
+
this._register(this.filePickBox.onDidTriggerButton(e => {
|
|
295
|
+
this.setShowDotFiles(!this._showDotFiles);
|
|
296
|
+
}));
|
|
270
297
|
let isResolving = 0;
|
|
271
298
|
let isAcceptHandled = false;
|
|
272
299
|
this.currentFolder = dirname(homedir);
|
|
@@ -396,6 +423,13 @@ let SimpleFileDialog = class SimpleFileDialog extends Disposable {
|
|
|
396
423
|
catch {
|
|
397
424
|
}
|
|
398
425
|
}
|
|
426
|
+
setButtons() {
|
|
427
|
+
this.filePickBox.buttons = [{
|
|
428
|
+
iconClass: this._showDotFiles ? ThemeIcon.asClassName(Codicon.eye) : ThemeIcon.asClassName(Codicon.eyeClosed),
|
|
429
|
+
tooltip: this._showDotFiles ? ( localize(11694, "Hide dot files")) : ( localize(11695, "Show dot files")),
|
|
430
|
+
alwaysVisible: true
|
|
431
|
+
}];
|
|
432
|
+
}
|
|
399
433
|
isBadSubpath(value) {
|
|
400
434
|
return this.badPath && (value.length > this.badPath.length) && equalsIgnoreCase(value.substring(0, this.badPath.length), this.badPath);
|
|
401
435
|
}
|
|
@@ -525,7 +559,7 @@ let SimpleFileDialog = class SimpleFileDialog extends Disposable {
|
|
|
525
559
|
}
|
|
526
560
|
return uri;
|
|
527
561
|
}
|
|
528
|
-
async tryUpdateItems(value, valueUri) {
|
|
562
|
+
async tryUpdateItems(value, valueUri, reset = false) {
|
|
529
563
|
if ((value.length > 0) && ((value[0] === '~') || this.canTildaEscapeHatch(value))) {
|
|
530
564
|
const newDir = this.tildaReplace(value);
|
|
531
565
|
return (await this.updateItems(newDir, true)) ? UpdateResult.UpdatedWithTrailing : UpdateResult.Updated;
|
|
@@ -540,7 +574,7 @@ let SimpleFileDialog = class SimpleFileDialog extends Disposable {
|
|
|
540
574
|
const newFolderIsSubFolder = extUriIgnorePathCase.isEqual(this.currentFolder, dirname(valueUri));
|
|
541
575
|
const newFolderIsParent = extUriIgnorePathCase.isEqualOrParent(this.currentFolder, dirname(valueUri));
|
|
542
576
|
const newFolderIsUnrelated = !newFolderIsParent && !newFolderIsSubFolder;
|
|
543
|
-
if (!newFolderIsOldFolder && (this.endsWithSlash(value) || newFolderIsParent || newFolderIsUnrelated)) {
|
|
577
|
+
if ((!newFolderIsOldFolder && (this.endsWithSlash(value) || newFolderIsParent || newFolderIsUnrelated)) || reset) {
|
|
544
578
|
let stat;
|
|
545
579
|
try {
|
|
546
580
|
stat = await this.fileService.stat(valueUri);
|
|
@@ -552,7 +586,7 @@ let SimpleFileDialog = class SimpleFileDialog extends Disposable {
|
|
|
552
586
|
return (await this.updateItems(valueUri)) ? UpdateResult.UpdatedWithTrailing : UpdateResult.Updated;
|
|
553
587
|
}
|
|
554
588
|
else if (this.endsWithSlash(value)) {
|
|
555
|
-
this.filePickBox.validationMessage = ( localize(
|
|
589
|
+
this.filePickBox.validationMessage = ( localize(11696, 'The path does not exist. Use ~ to go to your home directory.'));
|
|
556
590
|
this.badPath = value;
|
|
557
591
|
return UpdateResult.InvalidPath;
|
|
558
592
|
}
|
|
@@ -710,7 +744,7 @@ let SimpleFileDialog = class SimpleFileDialog extends Disposable {
|
|
|
710
744
|
prompt.ignoreFocusOut = true;
|
|
711
745
|
prompt.ok = true;
|
|
712
746
|
prompt.customButton = true;
|
|
713
|
-
prompt.customLabel = ( localize(
|
|
747
|
+
prompt.customLabel = ( localize(11697, 'Cancel'));
|
|
714
748
|
prompt.value = this.pathFromUri(uri);
|
|
715
749
|
let isResolving = false;
|
|
716
750
|
return ( new Promise(resolve => {
|
|
@@ -738,7 +772,7 @@ let SimpleFileDialog = class SimpleFileDialog extends Disposable {
|
|
|
738
772
|
}
|
|
739
773
|
async validate(uri) {
|
|
740
774
|
if (uri === undefined) {
|
|
741
|
-
this.filePickBox.validationMessage = ( localize(
|
|
775
|
+
this.filePickBox.validationMessage = ( localize(11698, 'Please enter a valid path.'));
|
|
742
776
|
return Promise.resolve(false);
|
|
743
777
|
}
|
|
744
778
|
let stat;
|
|
@@ -751,36 +785,36 @@ let SimpleFileDialog = class SimpleFileDialog extends Disposable {
|
|
|
751
785
|
}
|
|
752
786
|
if (this.requiresTrailing) {
|
|
753
787
|
if (stat && stat.isDirectory) {
|
|
754
|
-
this.filePickBox.validationMessage = ( localize(
|
|
788
|
+
this.filePickBox.validationMessage = ( localize(11699, 'The folder already exists. Please use a new file name.'));
|
|
755
789
|
return Promise.resolve(false);
|
|
756
790
|
}
|
|
757
791
|
else if (stat) {
|
|
758
792
|
const message = ( localize(
|
|
759
|
-
|
|
793
|
+
11700,
|
|
760
794
|
'{0} already exists. Are you sure you want to overwrite it?',
|
|
761
795
|
basename(uri)
|
|
762
796
|
));
|
|
763
797
|
return this.yesNoPrompt(uri, message);
|
|
764
798
|
}
|
|
765
799
|
else if (!(isValidBasename(basename(uri), this.isWindows))) {
|
|
766
|
-
this.filePickBox.validationMessage = ( localize(
|
|
800
|
+
this.filePickBox.validationMessage = ( localize(11701, 'Please enter a valid file name.'));
|
|
767
801
|
return Promise.resolve(false);
|
|
768
802
|
}
|
|
769
803
|
else if (!statDirname) {
|
|
770
804
|
const message = ( localize(
|
|
771
|
-
|
|
805
|
+
11702,
|
|
772
806
|
'The folder {0} does not exist. Would you like to create it?',
|
|
773
807
|
basename(dirname(uri))
|
|
774
808
|
));
|
|
775
809
|
return this.yesNoPrompt(uri, message);
|
|
776
810
|
}
|
|
777
811
|
else if (!statDirname.isDirectory) {
|
|
778
|
-
this.filePickBox.validationMessage = ( localize(
|
|
812
|
+
this.filePickBox.validationMessage = ( localize(11703, 'Please enter a path that exists.'));
|
|
779
813
|
return Promise.resolve(false);
|
|
780
814
|
}
|
|
781
815
|
else if (statDirname.readonly) {
|
|
782
816
|
this.filePickBox.validationMessage = ( localize(
|
|
783
|
-
|
|
817
|
+
11704,
|
|
784
818
|
'This folder cannot be used as a save destination. Please choose another folder'
|
|
785
819
|
));
|
|
786
820
|
return Promise.resolve(false);
|
|
@@ -788,19 +822,19 @@ let SimpleFileDialog = class SimpleFileDialog extends Disposable {
|
|
|
788
822
|
}
|
|
789
823
|
else {
|
|
790
824
|
if (!stat) {
|
|
791
|
-
this.filePickBox.validationMessage = ( localize(
|
|
825
|
+
this.filePickBox.validationMessage = ( localize(11703, 'Please enter a path that exists.'));
|
|
792
826
|
return Promise.resolve(false);
|
|
793
827
|
}
|
|
794
828
|
else if (uri.path === '/' && this.isWindows) {
|
|
795
|
-
this.filePickBox.validationMessage = ( localize(
|
|
829
|
+
this.filePickBox.validationMessage = ( localize(11705, 'Please start the path with a drive letter.'));
|
|
796
830
|
return Promise.resolve(false);
|
|
797
831
|
}
|
|
798
832
|
else if (stat.isDirectory && !this.allowFolderSelection) {
|
|
799
|
-
this.filePickBox.validationMessage = ( localize(
|
|
833
|
+
this.filePickBox.validationMessage = ( localize(11706, 'Please select a file.'));
|
|
800
834
|
return Promise.resolve(false);
|
|
801
835
|
}
|
|
802
836
|
else if (!stat.isDirectory && !this.allowFileSelection) {
|
|
803
|
-
this.filePickBox.validationMessage = ( localize(
|
|
837
|
+
this.filePickBox.validationMessage = ( localize(11707, 'Please select a folder.'));
|
|
804
838
|
return Promise.resolve(false);
|
|
805
839
|
}
|
|
806
840
|
}
|
|
@@ -913,7 +947,8 @@ let SimpleFileDialog = class SimpleFileDialog extends Disposable {
|
|
|
913
947
|
if (!folder) {
|
|
914
948
|
folder = await this.fileService.resolve(currentFolder);
|
|
915
949
|
}
|
|
916
|
-
const
|
|
950
|
+
const filteredChildren = this._showDotFiles ? folder.children : folder.children?.filter(child => !child.name.startsWith('.'));
|
|
951
|
+
const items = filteredChildren ? await Promise.all(( filteredChildren.map(child => this.createItem(child, currentFolder, token)))) : [];
|
|
917
952
|
for (const item of items) {
|
|
918
953
|
if (item) {
|
|
919
954
|
result.push(item);
|
|
@@ -983,7 +1018,8 @@ SimpleFileDialog = ( __decorate([
|
|
|
983
1018
|
( __param(10, IPathService)),
|
|
984
1019
|
( __param(11, IKeybindingService)),
|
|
985
1020
|
( __param(12, IContextKeyService)),
|
|
986
|
-
( __param(13, IAccessibilityService))
|
|
1021
|
+
( __param(13, IAccessibilityService)),
|
|
1022
|
+
( __param(14, IStorageService))
|
|
987
1023
|
], SimpleFileDialog));
|
|
988
1024
|
|
|
989
1025
|
export { OpenLocalFileCommand, OpenLocalFileFolderCommand, OpenLocalFolderCommand, RemoteFileDialogContext, SaveLocalFileCommand, SimpleFileDialog };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
-
import { IConfirmation, IConfirmationResult, IInput, IInputResult, IPrompt, IPromptResult, IPromptResultWithCancel, IPromptWithCustomCancel, IPromptWithDefaultCancel } from "@codingame/monaco-vscode-
|
|
2
|
+
import { IConfirmation, IConfirmationResult, IInput, IInputResult, IPrompt, IPromptResult, IPromptResultWithCancel, IPromptWithCustomCancel, IPromptWithDefaultCancel } from "@codingame/monaco-vscode-2e69e120-617a-5258-95e0-3b8902f4e014-common/vscode/vs/platform/dialogs/common/dialogs";
|
|
3
3
|
import { IDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service";
|
|
4
4
|
import { DialogsModel } from "../../../common/dialogs.js";
|
|
5
5
|
import { IWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service";
|