@codingame/monaco-vscode-dialogs-service-override 9.0.3 → 10.0.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-dialogs-service-override",
3
- "version": "9.0.3",
3
+ "version": "10.0.1",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -26,6 +26,6 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@9.0.3"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@10.0.1"
30
30
  }
31
31
  }
@@ -5,7 +5,7 @@ import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/
5
5
  import { ILayoutService } from 'vscode/vscode/vs/platform/layout/browser/layoutService.service';
6
6
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
7
7
  import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
8
- import { registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
8
+ import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
9
9
  import { BrowserDialogHandler } from './dialogHandler.js';
10
10
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
11
11
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
@@ -70,7 +70,6 @@ DialogHandlerContribution = ( __decorate([
70
70
  ( __param(5, IProductService)),
71
71
  ( __param(6, IClipboardService))
72
72
  ], DialogHandlerContribution));
73
- registerWorkbenchContribution2(DialogHandlerContribution.ID, DialogHandlerContribution, WorkbenchPhase.BlockStartup
74
- );
73
+ registerWorkbenchContribution2(DialogHandlerContribution.ID, DialogHandlerContribution, 1 );
75
74
 
76
75
  export { DialogHandlerContribution };
@@ -14,7 +14,6 @@ import { fromNow } from 'vscode/vscode/vs/base/common/date';
14
14
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
15
15
  import { MarkdownRenderer } from 'vscode/vscode/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer';
16
16
  import { defaultButtonStyles, defaultCheckboxStyles, defaultInputBoxStyles, defaultDialogStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
17
- import { ResultKind } from 'vscode/vscode/vs/platform/keybinding/common/keybindingResolver';
18
17
 
19
18
  var BrowserDialogHandler_1;
20
19
  let BrowserDialogHandler = class BrowserDialogHandler extends AbstractDialogHandler {
@@ -58,7 +57,7 @@ let BrowserDialogHandler = class BrowserDialogHandler extends AbstractDialogHand
58
57
  async about() {
59
58
  const detailString = (useAgo) => {
60
59
  return ( localize(
61
- 5653,
60
+ 5611,
62
61
  "Version: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}",
63
62
  this.productService.version || 'Unknown',
64
63
  this.productService.commit || 'Unknown',
@@ -69,8 +68,8 @@ let BrowserDialogHandler = class BrowserDialogHandler extends AbstractDialogHand
69
68
  const detail = detailString(true);
70
69
  const detailToCopy = detailString(false);
71
70
  const { button } = await this.doShow(Severity$1.Info, this.productService.nameLong, [
72
- ( localize(5654, "&&Copy")),
73
- ( localize(5655, "OK"))
71
+ ( localize(5612, "&&Copy")),
72
+ ( localize(5613, "OK"))
74
73
  ], detail, 1);
75
74
  if (button === 0) {
76
75
  this.clipboardService.writeText(detailToCopy);
@@ -93,7 +92,7 @@ let BrowserDialogHandler = class BrowserDialogHandler extends AbstractDialogHand
93
92
  type: this.getDialogType(type),
94
93
  keyEventProcessor: (event) => {
95
94
  const resolved = this.keybindingService.softDispatch(event, this.layoutService.activeContainer);
96
- if (resolved.kind === ResultKind.KbFound && resolved.commandId) {
95
+ if (resolved.kind === 2 && resolved.commandId) {
97
96
  if (BrowserDialogHandler_1.ALLOWABLE_COMMANDS.indexOf(resolved.commandId) === -1) {
98
97
  EventHelper.stop(event, true);
99
98
  }
@@ -1,8 +1,6 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
- import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
3
2
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
4
3
  import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
5
- import { StorageScope } from 'vscode/vscode/vs/platform/storage/common/storage';
6
4
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
7
5
  import { IBrowserWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/browser/environmentService.service';
8
6
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
@@ -15,7 +13,7 @@ import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/comma
15
13
  import { WelcomeWidget } from './welcomeWidget.js';
16
14
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
17
15
  import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.service';
18
- import { Extensions as Extensions$1, ConfigurationScope } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
16
+ import { Extensions as Extensions$1 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
19
17
  import { localize } from 'vscode/vscode/vs/nls';
20
18
  import { applicationConfigurationNodeBase } from 'vscode/vscode/vs/workbench/common/configuration';
21
19
  import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
@@ -26,7 +24,7 @@ let WelcomeDialogContribution = class WelcomeDialogContribution extends Disposab
26
24
  constructor(storageService, environmentService, configurationService, contextService, codeEditorService, instantiationService, commandService, telemetryService, openerService, editorService) {
27
25
  super();
28
26
  this.isRendered = false;
29
- if (!storageService.isNew(StorageScope.APPLICATION)) {
27
+ if (!storageService.isNew(-1 )) {
30
28
  return;
31
29
  }
32
30
  const setting = configurationService.inspect(configurationKey);
@@ -79,17 +77,17 @@ WelcomeDialogContribution = ( (__decorate([
79
77
  ( (__param(9, IEditorService)))
80
78
  ], WelcomeDialogContribution)));
81
79
  ( (Registry.as(Extensions.Workbench)))
82
- .registerWorkbenchContribution(WelcomeDialogContribution, LifecyclePhase.Eventually);
80
+ .registerWorkbenchContribution(WelcomeDialogContribution, 4 );
83
81
  const configurationRegistry = ( (Registry.as(Extensions$1.Configuration)));
84
82
  configurationRegistry.registerConfiguration({
85
83
  ...applicationConfigurationNodeBase,
86
84
  properties: {
87
85
  'workbench.welcome.experimental.dialog': {
88
- scope: ConfigurationScope.APPLICATION,
86
+ scope: 1 ,
89
87
  type: 'boolean',
90
88
  default: false,
91
89
  tags: ['experimental'],
92
- description: ( localize(2386, "When enabled, a welcome widget is shown in the editor"))
90
+ description: ( localize(2349, "When enabled, a welcome widget is shown in the editor"))
93
91
  }
94
92
  }
95
93
  });
@@ -1,6 +1,5 @@
1
1
  import './media/welcomeWidget.css.js';
2
2
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
- import { OverlayWidgetPositionPreference } from 'vscode/vscode/vs/editor/browser/editorBrowser';
4
3
  import { $, hide, append } from 'vscode/vscode/vs/base/browser/dom';
5
4
  import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
6
5
  import { MarkdownRenderer } from 'vscode/vscode/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer';
@@ -71,7 +70,7 @@ class WelcomeWidget extends Disposable {
71
70
  }
72
71
  async buildWidgetContent(title, message, buttonText, buttonAction) {
73
72
  const actionBar = this._register(( (new ActionBar(this.element, {}))));
74
- const action = this._register(( (new Action('dialog.close', ( localize(5656, "Close Dialog")), ThemeIcon.asClassName(Codicon.dialogClose), true, async () => {
73
+ const action = this._register(( (new Action('dialog.close', ( localize(5614, "Close Dialog")), ThemeIcon.asClassName(Codicon.dialogClose), true, async () => {
75
74
  this._hide();
76
75
  }))));
77
76
  actionBar.push(action, { icon: true, label: false });
@@ -134,7 +133,7 @@ class WelcomeWidget extends Disposable {
134
133
  }
135
134
  getPosition() {
136
135
  return {
137
- preference: OverlayWidgetPositionPreference.TOP_RIGHT_CORNER
136
+ preference: 0
138
137
  };
139
138
  }
140
139
  _show() {
@@ -1,9 +1,9 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { localize } from 'vscode/vscode/vs/nls';
3
3
  import { isWorkspaceToOpen, isFileToOpen } from 'vscode/vscode/vs/platform/window/common/window';
4
- import { ConfirmResult, getFileNamesMessage } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
4
+ import { getFileNamesMessage } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
5
5
  import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
6
- import { WorkbenchState, isSavedWorkspace, isTemporaryWorkspace, WORKSPACE_EXTENSION } from 'vscode/vscode/vs/platform/workspace/common/workspace';
6
+ import { isSavedWorkspace, isTemporaryWorkspace, WORKSPACE_EXTENSION } from 'vscode/vscode/vs/platform/workspace/common/workspace';
7
7
  import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
8
8
  import { IHistoryService } from 'vscode/vscode/vs/workbench/services/history/common/history.service';
9
9
  import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
@@ -91,7 +91,7 @@ let AbstractFileDialogService = class AbstractFileDialogService {
91
91
  }
92
92
  async defaultWorkspacePath(schemeFilter = this.getSchemeFilterForWindow()) {
93
93
  let defaultWorkspacePath;
94
- if (this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE) {
94
+ if (this.contextService.getWorkbenchState() === 3 ) {
95
95
  const configuration = this.contextService.getWorkspace().configuration;
96
96
  if (configuration?.scheme === schemeFilter && isSavedWorkspace(configuration, this.environmentService) && !isTemporaryWorkspace(configuration)) {
97
97
  defaultWorkspacePath = dirname(configuration);
@@ -105,7 +105,7 @@ let AbstractFileDialogService = class AbstractFileDialogService {
105
105
  async showSaveConfirm(fileNamesOrResources) {
106
106
  if (this.skipDialogs()) {
107
107
  this.logService.trace('FileDialogService: refused to show save confirmation dialog in tests.');
108
- return ConfirmResult.DONT_SAVE;
108
+ return 1 ;
109
109
  }
110
110
  return this.doShowSaveConfirm(fileNamesOrResources);
111
111
  }
@@ -117,20 +117,20 @@ let AbstractFileDialogService = class AbstractFileDialogService {
117
117
  }
118
118
  async doShowSaveConfirm(fileNamesOrResources) {
119
119
  if (fileNamesOrResources.length === 0) {
120
- return ConfirmResult.DONT_SAVE;
120
+ return 1 ;
121
121
  }
122
122
  let message;
123
- let detail = ( localize(5637, "Your changes will be lost if you don't save them."));
123
+ let detail = ( localize(5595, "Your changes will be lost if you don't save them."));
124
124
  if (fileNamesOrResources.length === 1) {
125
125
  message = ( localize(
126
- 5638,
126
+ 5596,
127
127
  "Do you want to save the changes you made to {0}?",
128
128
  typeof fileNamesOrResources[0] === 'string' ? fileNamesOrResources[0] : basename(fileNamesOrResources[0])
129
129
  ));
130
130
  }
131
131
  else {
132
132
  message = ( localize(
133
- 5639,
133
+ 5597,
134
134
  "Do you want to save the changes to the following {0} files?",
135
135
  fileNamesOrResources.length
136
136
  ));
@@ -143,17 +143,17 @@ let AbstractFileDialogService = class AbstractFileDialogService {
143
143
  buttons: [
144
144
  {
145
145
  label: fileNamesOrResources.length > 1 ?
146
- ( localize(5640, "&&Save All")) :
147
- ( localize(5641, "&&Save")),
148
- run: () => ConfirmResult.SAVE
146
+ ( localize(5598, "&&Save All")) :
147
+ ( localize(5599, "&&Save")),
148
+ run: () => 0
149
149
  },
150
150
  {
151
- label: ( localize(5642, "Do&&n't Save")),
152
- run: () => ConfirmResult.DONT_SAVE
151
+ label: ( localize(5600, "Do&&n't Save")),
152
+ run: () => 1
153
153
  }
154
154
  ],
155
155
  cancelButton: {
156
- run: () => ConfirmResult.CANCEL
156
+ run: () => 2
157
157
  }
158
158
  });
159
159
  return result;
@@ -162,7 +162,7 @@ let AbstractFileDialogService = class AbstractFileDialogService {
162
162
  return schema === Schemas.untitled ? [Schemas.file] : (schema !== Schemas.file ? [schema, Schemas.file] : [schema]);
163
163
  }
164
164
  async pickFileFolderAndOpenSimplified(schema, options, preferNewWindow) {
165
- const title = ( localize(5643, 'Open File or Folder'));
165
+ const title = ( localize(5601, 'Open File or Folder'));
166
166
  const availableFileSystems = this.addFileSchemaIfNeeded(schema);
167
167
  const uri = await this.pickResource({ canSelectFiles: true, canSelectFolders: true, canSelectMany: false, defaultUri: options.defaultUri, title, availableFileSystems });
168
168
  if (uri) {
@@ -180,7 +180,7 @@ let AbstractFileDialogService = class AbstractFileDialogService {
180
180
  }
181
181
  }
182
182
  async pickFileAndOpenSimplified(schema, options, preferNewWindow) {
183
- const title = ( localize(5644, 'Open File'));
183
+ const title = ( localize(5602, 'Open File'));
184
184
  const availableFileSystems = this.addFileSchemaIfNeeded(schema);
185
185
  const uri = await this.pickResource({ canSelectFiles: true, canSelectFolders: false, canSelectMany: false, defaultUri: options.defaultUri, title, availableFileSystems });
186
186
  if (uri) {
@@ -197,7 +197,7 @@ let AbstractFileDialogService = class AbstractFileDialogService {
197
197
  this.workspacesService.addRecentlyOpened([{ fileUri: uri, label: this.labelService.getUriLabel(uri) }]);
198
198
  }
199
199
  async pickFolderAndOpenSimplified(schema, options) {
200
- const title = ( localize(5645, 'Open Folder'));
200
+ const title = ( localize(5603, 'Open Folder'));
201
201
  const availableFileSystems = this.addFileSchemaIfNeeded(schema, true);
202
202
  const uri = await this.pickResource({ canSelectFiles: false, canSelectFolders: true, canSelectMany: false, defaultUri: options.defaultUri, title, availableFileSystems });
203
203
  if (uri) {
@@ -205,8 +205,8 @@ let AbstractFileDialogService = class AbstractFileDialogService {
205
205
  }
206
206
  }
207
207
  async pickWorkspaceAndOpenSimplified(schema, options) {
208
- const title = ( localize(5646, 'Open Workspace from File'));
209
- const filters = [{ name: ( localize(5647, 'Workspace')), extensions: [WORKSPACE_EXTENSION] }];
208
+ const title = ( localize(5604, 'Open Workspace from File'));
209
+ const filters = [{ name: ( localize(5605, 'Workspace')), extensions: [WORKSPACE_EXTENSION] }];
210
210
  const availableFileSystems = this.addFileSchemaIfNeeded(schema, true);
211
211
  const uri = await this.pickResource({ canSelectFiles: true, canSelectFolders: false, canSelectMany: false, defaultUri: options.defaultUri, title, filters, availableFileSystems });
212
212
  if (uri) {
@@ -217,7 +217,7 @@ let AbstractFileDialogService = class AbstractFileDialogService {
217
217
  if (!options.availableFileSystems) {
218
218
  options.availableFileSystems = this.addFileSchemaIfNeeded(schema);
219
219
  }
220
- options.title = ( localize(5648, 'Save As'));
220
+ options.title = ( localize(5606, 'Save As'));
221
221
  const uri = await this.saveRemoteResource(options);
222
222
  if (uri) {
223
223
  this.addFileToRecentlyOpened(uri);
@@ -268,7 +268,7 @@ let AbstractFileDialogService = class AbstractFileDialogService {
268
268
  getPickFileToSaveDialogOptions(defaultUri, availableFileSystems) {
269
269
  const options = {
270
270
  defaultUri,
271
- title: ( localize(5649, "Save As")),
271
+ title: ( localize(5607, "Save As")),
272
272
  availableFileSystems
273
273
  };
274
274
  const ext = defaultUri ? extname(defaultUri) : undefined;
@@ -295,10 +295,10 @@ let AbstractFileDialogService = class AbstractFileDialogService {
295
295
  matchingFilter = { name: trim(ext, '.').toUpperCase(), extensions: [trim(ext, '.')] };
296
296
  }
297
297
  options.filters = coalesce([
298
- { name: ( localize(5650, "All Files")), extensions: ['*'] },
298
+ { name: ( localize(5608, "All Files")), extensions: ['*'] },
299
299
  matchingFilter,
300
300
  ...registeredLanguageFilters,
301
- { name: ( localize(5651, "No Extension")), extensions: [''] }
301
+ { name: ( localize(5609, "No Extension")), extensions: [''] }
302
302
  ]);
303
303
  return options;
304
304
  }
@@ -1,6 +1,5 @@
1
1
  import { __decorate } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
3
- import 'vscode/vscode/vs/platform/instantiation/common/extensions';
4
3
  import { AbstractFileDialogService } from './abstractFileDialogService.js';
5
4
  import { Schemas } from 'vscode/vscode/vs/base/common/network';
6
5
  import { memoize } from 'vscode/vscode/vs/base/common/decorators';
@@ -28,7 +27,7 @@ class FileDialogService extends AbstractFileDialogService {
28
27
  return super.pickFileFolderAndOpenSimplified(schema, options, false);
29
28
  }
30
29
  throw ( (new Error(
31
- localize(2379, "Can't open folders, try adding a folder to the workspace instead.")
30
+ localize(2342, "Can't open folders, try adding a folder to the workspace instead.")
32
31
  )));
33
32
  }
34
33
  addFileSchemaIfNeeded(schema, isFolder) {
@@ -70,7 +69,7 @@ class FileDialogService extends AbstractFileDialogService {
70
69
  return super.pickFolderAndOpenSimplified(schema, options);
71
70
  }
72
71
  throw ( (new Error(
73
- localize(2379, "Can't open folders, try adding a folder to the workspace instead.")
72
+ localize(2342, "Can't open folders, try adding a folder to the workspace instead.")
74
73
  )));
75
74
  }
76
75
  async pickWorkspaceAndOpen(options) {
@@ -83,7 +82,7 @@ class FileDialogService extends AbstractFileDialogService {
83
82
  return super.pickWorkspaceAndOpenSimplified(schema, options);
84
83
  }
85
84
  throw ( (new Error(localize(
86
- 2380,
85
+ 2343,
87
86
  "Can't open workspaces, try adding a folder to the workspace instead."
88
87
  ))));
89
88
  }
@@ -185,17 +184,17 @@ class FileDialogService extends AbstractFileDialogService {
185
184
  }
186
185
  const buttons = [
187
186
  {
188
- label: ( localize(2381, "&&Open Remote...")),
187
+ label: ( localize(2344, "&&Open Remote...")),
189
188
  run: async () => { await this.commandService.executeCommand('workbench.action.remote.showMenu'); }
190
189
  },
191
190
  {
192
- label: ( localize(2382, "&&Learn More")),
191
+ label: ( localize(2345, "&&Learn More")),
193
192
  run: async () => { await this.openerService.open('https://aka.ms/VSCodeWebLocalFileSystemAccess'); }
194
193
  }
195
194
  ];
196
195
  if (context === 'open') {
197
196
  buttons.push({
198
- label: ( localize(2383, "Open &&Files...")),
197
+ label: ( localize(2346, "Open &&Files...")),
199
198
  run: async () => {
200
199
  const files = await triggerUpload();
201
200
  if (files) {
@@ -215,9 +214,9 @@ class FileDialogService extends AbstractFileDialogService {
215
214
  }
216
215
  await this.dialogService.prompt({
217
216
  type: Severity$1.Warning,
218
- message: ( localize(2384, "Opening Local Folders is Unsupported")),
217
+ message: ( localize(2347, "Opening Local Folders is Unsupported")),
219
218
  detail: ( localize(
220
- 2385,
219
+ 2348,
221
220
  "Your browser doesn't support opening local folders.\nYou can either open single files or open a remote repository."
222
221
  )),
223
222
  buttons
@@ -7,7 +7,7 @@ import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.servi
7
7
  import { ItemActivation } from 'vscode/vscode/vs/platform/quickinput/common/quickInput';
8
8
  import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
9
9
  import { URI } from 'vscode/vscode/vs/base/common/uri';
10
- import { isWindows, OperatingSystem } from 'vscode/vscode/vs/base/common/platform';
10
+ import { isWindows } from 'vscode/vscode/vs/base/common/platform';
11
11
  import { IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
12
12
  import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
13
13
  import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
@@ -24,11 +24,10 @@ import { format, equalsIgnoreCase, startsWithIgnoreCase } from 'vscode/vscode/vs
24
24
  import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
25
25
  import { isValidBasename } from 'vscode/vscode/vs/base/common/extpath';
26
26
  import { Emitter } from 'vscode/vscode/vs/base/common/event';
27
- import { dispose } from 'vscode/vscode/vs/base/common/lifecycle';
27
+ import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
28
28
  import { createCancelablePromise } from 'vscode/vscode/vs/base/common/async';
29
29
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
30
30
  import { normalizeDriveLetter } from 'vscode/vscode/vs/base/common/labels';
31
- import { SaveReason } from 'vscode/vscode/vs/workbench/common/editor';
32
31
  import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService.service';
33
32
  import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility.service';
34
33
  import { getActiveDocument } from 'vscode/vscode/vs/base/browser/dom';
@@ -36,7 +35,7 @@ import { getActiveDocument } from 'vscode/vscode/vs/base/browser/dom';
36
35
  var OpenLocalFileCommand;
37
36
  ( ((function(OpenLocalFileCommand) {
38
37
  OpenLocalFileCommand.ID = 'workbench.action.files.openLocalFile';
39
- OpenLocalFileCommand.LABEL = ( localize(10152, "Open Local File..."));
38
+ OpenLocalFileCommand.LABEL = ( localize(10225, "Open Local File..."));
40
39
  function handler() {
41
40
  return accessor => {
42
41
  const dialogService = accessor.get(IFileDialogService);
@@ -48,13 +47,13 @@ var OpenLocalFileCommand;
48
47
  var SaveLocalFileCommand;
49
48
  ( ((function(SaveLocalFileCommand) {
50
49
  SaveLocalFileCommand.ID = 'workbench.action.files.saveLocalFile';
51
- SaveLocalFileCommand.LABEL = ( localize(10153, "Save Local File..."));
50
+ SaveLocalFileCommand.LABEL = ( localize(10226, "Save Local File..."));
52
51
  function handler() {
53
52
  return accessor => {
54
53
  const editorService = accessor.get(IEditorService);
55
54
  const activeEditorPane = editorService.activeEditorPane;
56
55
  if (activeEditorPane) {
57
- return editorService.save({ groupId: activeEditorPane.group.id, editor: activeEditorPane.input }, { saveAs: true, availableFileSystems: [Schemas.file], reason: SaveReason.EXPLICIT });
56
+ return editorService.save({ groupId: activeEditorPane.group.id, editor: activeEditorPane.input }, { saveAs: true, availableFileSystems: [Schemas.file], reason: 1 });
58
57
  }
59
58
  return Promise.resolve(undefined);
60
59
  };
@@ -64,7 +63,7 @@ var SaveLocalFileCommand;
64
63
  var OpenLocalFolderCommand;
65
64
  ( ((function(OpenLocalFolderCommand) {
66
65
  OpenLocalFolderCommand.ID = 'workbench.action.files.openLocalFolder';
67
- OpenLocalFolderCommand.LABEL = ( localize(10154, "Open Local Folder..."));
66
+ OpenLocalFolderCommand.LABEL = ( localize(10227, "Open Local Folder..."));
68
67
  function handler() {
69
68
  return accessor => {
70
69
  const dialogService = accessor.get(IFileDialogService);
@@ -76,7 +75,7 @@ var OpenLocalFolderCommand;
76
75
  var OpenLocalFileFolderCommand;
77
76
  ( ((function(OpenLocalFileFolderCommand) {
78
77
  OpenLocalFileFolderCommand.ID = 'workbench.action.files.openLocalFileFolder';
79
- OpenLocalFileFolderCommand.LABEL = ( localize(10155, "Open Local..."));
78
+ OpenLocalFileFolderCommand.LABEL = ( localize(10228, "Open Local..."));
80
79
  function handler() {
81
80
  return accessor => {
82
81
  const dialogService = accessor.get(IFileDialogService);
@@ -94,8 +93,9 @@ var UpdateResult;
94
93
  UpdateResult[UpdateResult["InvalidPath"] = 4] = "InvalidPath";
95
94
  })(UpdateResult || (UpdateResult = {}))));
96
95
  const RemoteFileDialogContext = ( (new RawContextKey('remoteFileDialogVisible', false)));
97
- let SimpleFileDialog = class SimpleFileDialog {
96
+ let SimpleFileDialog = class SimpleFileDialog extends Disposable {
98
97
  constructor(fileService, quickInputService, labelService, workspaceContextService, notificationService, fileDialogService, modelService, languageService, environmentService, remoteAgentService, pathService, keybindingService, contextKeyService, accessibilityService) {
98
+ super();
99
99
  this.fileService = fileService;
100
100
  this.quickInputService = quickInputService;
101
101
  this.labelService = labelService;
@@ -117,10 +117,7 @@ let SimpleFileDialog = class SimpleFileDialog {
117
117
  this.autoCompletePathSegment = '';
118
118
  this.isWindows = false;
119
119
  this.separator = '/';
120
- this.onBusyChangeEmitter = ( (new Emitter()));
121
- this.disposables = [
122
- this.onBusyChangeEmitter
123
- ];
120
+ this.onBusyChangeEmitter = this._register(( (new Emitter())));
124
121
  this.remoteAuthority = this.environmentService.remoteAuthority;
125
122
  this.contextKey = RemoteFileDialogContext.bindTo(contextKeyService);
126
123
  this.scheme = this.pathService.defaultUriScheme;
@@ -180,7 +177,7 @@ let SimpleFileDialog = class SimpleFileDialog {
180
177
  }
181
178
  if ((this.scheme !== Schemas.file) && !this.fileService.hasProvider(defaultUri)) {
182
179
  this.notificationService.info(( localize(
183
- 10156,
180
+ 10229,
184
181
  'File system provider for {0} is not available.',
185
182
  (defaultUri.toString())
186
183
  )));
@@ -246,7 +243,7 @@ let SimpleFileDialog = class SimpleFileDialog {
246
243
  }
247
244
  return (
248
245
  (new Promise((resolve) => {
249
- this.filePickBox = this.quickInputService.createQuickPick();
246
+ this.filePickBox = this._register(this.quickInputService.createQuickPick());
250
247
  this.busy = true;
251
248
  this.filePickBox.matchOnLabel = false;
252
249
  this.filePickBox.sortByLabel = false;
@@ -254,7 +251,7 @@ let SimpleFileDialog = class SimpleFileDialog {
254
251
  this.filePickBox.ok = true;
255
252
  if ((this.scheme !== Schemas.file) && this.options && this.options.availableFileSystems && (this.options.availableFileSystems.length > 1) && (this.options.availableFileSystems.indexOf(Schemas.file) > -1)) {
256
253
  this.filePickBox.customButton = true;
257
- this.filePickBox.customLabel = ( localize(10157, 'Show Local'));
254
+ this.filePickBox.customLabel = ( localize(10230, 'Show Local'));
258
255
  let action;
259
256
  if (isSave) {
260
257
  action = SaveLocalFileCommand;
@@ -278,17 +275,16 @@ let SimpleFileDialog = class SimpleFileDialog {
278
275
  this.filePickBox.title = this.options.title;
279
276
  this.filePickBox.value = this.pathFromUri(this.currentFolder, true);
280
277
  this.filePickBox.valueSelection = [this.filePickBox.value.length, this.filePickBox.value.length];
281
- function doResolve(dialog, uri) {
278
+ const doResolve = (uri) => {
282
279
  if (uri) {
283
- uri = addTrailingPathSeparator(uri, dialog.separator);
280
+ uri = addTrailingPathSeparator(uri, this.separator);
284
281
  uri = removeTrailingPathSeparator(uri);
285
282
  }
286
283
  resolve(uri);
287
- dialog.contextKey.set(false);
288
- dialog.filePickBox.dispose();
289
- dispose(dialog.disposables);
290
- }
291
- this.filePickBox.onDidCustom(() => {
284
+ this.contextKey.set(false);
285
+ this.dispose();
286
+ };
287
+ this._register(this.filePickBox.onDidCustom(() => {
292
288
  if (isAcceptHandled || this.busy) {
293
289
  return;
294
290
  }
@@ -300,20 +296,20 @@ let SimpleFileDialog = class SimpleFileDialog {
300
296
  this.filePickBox.hide();
301
297
  if (isSave) {
302
298
  return this.fileDialogService.showSaveDialog(this.options).then(result => {
303
- doResolve(this, result);
299
+ doResolve(result);
304
300
  });
305
301
  }
306
302
  else {
307
303
  return this.fileDialogService.showOpenDialog(this.options).then(result => {
308
- doResolve(this, result ? result[0] : undefined);
304
+ doResolve(result ? result[0] : undefined);
309
305
  });
310
306
  }
311
- });
312
- function handleAccept(dialog) {
313
- if (dialog.busy) {
314
- dialog.onBusyChangeEmitter.event((busy) => {
307
+ }));
308
+ const handleAccept = () => {
309
+ if (this.busy) {
310
+ this.onBusyChangeEmitter.event((busy) => {
315
311
  if (!busy) {
316
- handleAccept(dialog);
312
+ handleAccept();
317
313
  }
318
314
  });
319
315
  return;
@@ -323,24 +319,24 @@ let SimpleFileDialog = class SimpleFileDialog {
323
319
  }
324
320
  isAcceptHandled = true;
325
321
  isResolving++;
326
- dialog.onDidAccept().then(resolveValue => {
322
+ this.onDidAccept().then(resolveValue => {
327
323
  if (resolveValue) {
328
- dialog.filePickBox.hide();
329
- doResolve(dialog, resolveValue);
324
+ this.filePickBox.hide();
325
+ doResolve(resolveValue);
330
326
  }
331
- else if (dialog.hidden) {
332
- doResolve(dialog, undefined);
327
+ else if (this.hidden) {
328
+ doResolve(undefined);
333
329
  }
334
330
  else {
335
331
  isResolving--;
336
332
  isAcceptHandled = false;
337
333
  }
338
334
  });
339
- }
340
- this.filePickBox.onDidAccept(_ => {
341
- handleAccept(this);
342
- });
343
- this.filePickBox.onDidChangeActive(i => {
335
+ };
336
+ this._register(this.filePickBox.onDidAccept(_ => {
337
+ handleAccept();
338
+ }));
339
+ this._register(this.filePickBox.onDidChangeActive(i => {
344
340
  isAcceptHandled = false;
345
341
  if ((i.length === 1) && this.isSelectionChangeFromUser()) {
346
342
  this.filePickBox.validationMessage = undefined;
@@ -351,16 +347,16 @@ let SimpleFileDialog = class SimpleFileDialog {
351
347
  }
352
348
  this.setAutoComplete(userPath, this.userEnteredPathSegment, i[0], true);
353
349
  }
354
- });
355
- this.filePickBox.onDidChangeValue(async (value) => {
350
+ }));
351
+ this._register(this.filePickBox.onDidChangeValue(async (value) => {
356
352
  return this.handleValueChange(value);
357
- });
358
- this.filePickBox.onDidHide(() => {
353
+ }));
354
+ this._register(this.filePickBox.onDidHide(() => {
359
355
  this.hidden = true;
360
356
  if (isResolving === 0) {
361
- doResolve(this, undefined);
357
+ doResolve(undefined);
362
358
  }
363
- });
359
+ }));
364
360
  this.filePickBox.show();
365
361
  this.contextKey.set(true);
366
362
  this.updateItems(homedir, true, this.trailing).then(() => {
@@ -375,6 +371,9 @@ let SimpleFileDialog = class SimpleFileDialog {
375
371
  }))
376
372
  );
377
373
  }
374
+ dispose() {
375
+ super.dispose();
376
+ }
378
377
  async handleValueChange(value) {
379
378
  try {
380
379
  if (this.isValueChangeFromUser()) {
@@ -548,7 +547,7 @@ let SimpleFileDialog = class SimpleFileDialog {
548
547
  return (await this.updateItems(valueUri)) ? UpdateResult.UpdatedWithTrailing : UpdateResult.Updated;
549
548
  }
550
549
  else if (this.endsWithSlash(value)) {
551
- this.filePickBox.validationMessage = ( localize(10158, 'The path does not exist.'));
550
+ this.filePickBox.validationMessage = ( localize(10231, 'The path does not exist.'));
552
551
  this.badPath = value;
553
552
  return UpdateResult.InvalidPath;
554
553
  }
@@ -700,42 +699,43 @@ let SimpleFileDialog = class SimpleFileDialog {
700
699
  return ((path.length > 1) && this.endsWithSlash(path)) ? path.substr(0, path.length - 1) : path;
701
700
  }
702
701
  yesNoPrompt(uri, message) {
703
- const prompt = this.quickInputService.createQuickPick();
702
+ const disposableStore = ( (new DisposableStore()));
703
+ const prompt = disposableStore.add(this.quickInputService.createQuickPick());
704
704
  prompt.title = message;
705
705
  prompt.ignoreFocusOut = true;
706
706
  prompt.ok = true;
707
707
  prompt.customButton = true;
708
- prompt.customLabel = ( localize(10159, 'Cancel'));
708
+ prompt.customLabel = ( localize(10232, 'Cancel'));
709
709
  prompt.value = this.pathFromUri(uri);
710
710
  let isResolving = false;
711
711
  return (
712
712
  (new Promise(resolve => {
713
- prompt.onDidAccept(() => {
713
+ disposableStore.add(prompt.onDidAccept(() => {
714
714
  isResolving = true;
715
715
  prompt.hide();
716
716
  resolve(true);
717
- });
718
- prompt.onDidHide(() => {
717
+ }));
718
+ disposableStore.add(prompt.onDidHide(() => {
719
719
  if (!isResolving) {
720
720
  resolve(false);
721
721
  }
722
722
  this.filePickBox.show();
723
723
  this.hidden = false;
724
- prompt.dispose();
725
- });
726
- prompt.onDidChangeValue(() => {
724
+ disposableStore.dispose();
725
+ }));
726
+ disposableStore.add(prompt.onDidChangeValue(() => {
727
727
  prompt.hide();
728
- });
729
- prompt.onDidCustom(() => {
728
+ }));
729
+ disposableStore.add(prompt.onDidCustom(() => {
730
730
  prompt.hide();
731
- });
731
+ }));
732
732
  prompt.show();
733
733
  }))
734
734
  );
735
735
  }
736
736
  async validate(uri) {
737
737
  if (uri === undefined) {
738
- this.filePickBox.validationMessage = ( localize(10160, 'Please enter a valid path.'));
738
+ this.filePickBox.validationMessage = ( localize(10233, 'Please enter a valid path.'));
739
739
  return Promise.resolve(false);
740
740
  }
741
741
  let stat;
@@ -748,36 +748,36 @@ let SimpleFileDialog = class SimpleFileDialog {
748
748
  }
749
749
  if (this.requiresTrailing) {
750
750
  if (stat && stat.isDirectory) {
751
- this.filePickBox.validationMessage = ( localize(10161, 'The folder already exists. Please use a new file name.'));
751
+ this.filePickBox.validationMessage = ( localize(10234, 'The folder already exists. Please use a new file name.'));
752
752
  return Promise.resolve(false);
753
753
  }
754
754
  else if (stat) {
755
755
  const message = ( localize(
756
- 10162,
756
+ 10235,
757
757
  '{0} already exists. Are you sure you want to overwrite it?',
758
758
  basename(uri)
759
759
  ));
760
760
  return this.yesNoPrompt(uri, message);
761
761
  }
762
762
  else if (!(isValidBasename(basename(uri), this.isWindows))) {
763
- this.filePickBox.validationMessage = ( localize(10163, 'Please enter a valid file name.'));
763
+ this.filePickBox.validationMessage = ( localize(10236, 'Please enter a valid file name.'));
764
764
  return Promise.resolve(false);
765
765
  }
766
766
  else if (!statDirname) {
767
767
  const message = ( localize(
768
- 10164,
768
+ 10237,
769
769
  'The folder {0} does not exist. Would you like to create it?',
770
770
  basename(dirname(uri))
771
771
  ));
772
772
  return this.yesNoPrompt(uri, message);
773
773
  }
774
774
  else if (!statDirname.isDirectory) {
775
- this.filePickBox.validationMessage = ( localize(10165, 'Please enter a path that exists.'));
775
+ this.filePickBox.validationMessage = ( localize(10238, 'Please enter a path that exists.'));
776
776
  return Promise.resolve(false);
777
777
  }
778
778
  else if (statDirname.readonly) {
779
779
  this.filePickBox.validationMessage = ( localize(
780
- 10166,
780
+ 10239,
781
781
  'This folder cannot be used as a save destination. Please choose another folder'
782
782
  ));
783
783
  return Promise.resolve(false);
@@ -785,19 +785,19 @@ let SimpleFileDialog = class SimpleFileDialog {
785
785
  }
786
786
  else {
787
787
  if (!stat) {
788
- this.filePickBox.validationMessage = ( localize(10165, 'Please enter a path that exists.'));
788
+ this.filePickBox.validationMessage = ( localize(10238, 'Please enter a path that exists.'));
789
789
  return Promise.resolve(false);
790
790
  }
791
791
  else if (uri.path === '/' && this.isWindows) {
792
- this.filePickBox.validationMessage = ( localize(10167, 'Please start the path with a drive letter.'));
792
+ this.filePickBox.validationMessage = ( localize(10240, 'Please start the path with a drive letter.'));
793
793
  return Promise.resolve(false);
794
794
  }
795
795
  else if (stat.isDirectory && !this.allowFolderSelection) {
796
- this.filePickBox.validationMessage = ( localize(10168, 'Please select a file.'));
796
+ this.filePickBox.validationMessage = ( localize(10241, 'Please select a file.'));
797
797
  return Promise.resolve(false);
798
798
  }
799
799
  else if (!stat.isDirectory && !this.allowFileSelection) {
800
- this.filePickBox.validationMessage = ( localize(10169, 'Please select a folder.'));
800
+ this.filePickBox.validationMessage = ( localize(10242, 'Please select a folder.'));
801
801
  return Promise.resolve(false);
802
802
  }
803
803
  }
@@ -878,7 +878,7 @@ let SimpleFileDialog = class SimpleFileDialog {
878
878
  let isWindowsOS = isWindows;
879
879
  const env = await this.getRemoteAgentEnvironment();
880
880
  if (env) {
881
- isWindowsOS = env.os === OperatingSystem.Windows;
881
+ isWindowsOS = env.os === 1 ;
882
882
  }
883
883
  return isWindowsOS;
884
884
  }
@@ -3,7 +3,6 @@ import Severity$1 from 'vscode/vscode/vs/base/common/severity';
3
3
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
4
  import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
5
5
  import { DialogsModel } from '../../../common/dialogs.js';
6
- import 'vscode/vscode/vs/platform/instantiation/common/extensions';
7
6
  import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
8
7
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
9
8