@codingame/monaco-vscode-views-service-override 1.83.2 → 1.83.3

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.
Files changed (54) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/base/browser/ui/tree/treeDefaults.js +1 -1
  3. package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +50 -179
  4. package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarActions.js +44 -21
  5. package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +12 -12
  6. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +3 -3
  7. package/vscode/src/vs/workbench/browser/parts/compositeBar.js +2 -2
  8. package/vscode/src/vs/workbench/browser/parts/compositePart.js +4 -4
  9. package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsControl.js +24 -18
  10. package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.js +2 -2
  11. package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +2 -6
  12. package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +5 -5
  13. package/vscode/src/vs/workbench/browser/parts/editor/editorGroupWatermark.js +12 -18
  14. package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +3 -3
  15. package/vscode/src/vs/workbench/browser/parts/editor/editorTabsControl.js +3 -3
  16. package/vscode/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.js +5 -2
  17. package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +16 -8
  18. package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +2 -2
  19. package/vscode/src/vs/workbench/browser/parts/views/treeView.js +20 -28
  20. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +20 -24
  21. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +6 -6
  22. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +4 -4
  23. package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +10 -15
  24. package/vscode/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.js +4 -2
  25. package/vscode/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsTree.js +4 -9
  26. package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +1 -1
  27. package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +8 -29
  28. package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +2 -2
  29. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +12 -19
  30. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +17 -55
  31. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +110 -38
  32. package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +6 -11
  33. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution2.js +463 -3
  34. package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +5 -11
  35. package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +4 -1
  36. package/vscode/src/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.js +6 -6
  37. package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +31 -23
  38. package/vscode/src/vs/workbench/contrib/outline/browser/outline.contribution.js +37 -76
  39. package/vscode/src/vs/workbench/contrib/outline/browser/outlinePane.js +4 -4
  40. package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +5 -21
  41. package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +17 -23
  42. package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +62 -117
  43. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +18 -16
  44. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +6 -6
  45. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +4 -4
  46. package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +2 -2
  47. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +5 -5
  48. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +2 -2
  49. package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +10 -25
  50. package/vscode/src/vs/workbench/services/history/browser/historyService.js +37 -28
  51. package/vscode/src/vs/workbench/services/hover/browser/hoverWidget.js +2 -2
  52. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +2 -2
  53. package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +3 -3
  54. package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +2 -2
@@ -1,5 +1,5 @@
1
1
  import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
2
- import { localize } from 'monaco-editor/esm/vs/nls.js';
2
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
3
3
  import { toErrorMessage } from 'monaco-editor/esm/vs/base/common/errorMessage.js';
4
4
  import { isEqual, basename } from 'monaco-editor/esm/vs/base/common/resources.js';
5
5
  import { Action } from 'monaco-editor/esm/vs/base/common/actions.js';
@@ -29,10 +29,7 @@ import { hash } from 'monaco-editor/esm/vs/base/common/hash.js';
29
29
  const CONFLICT_RESOLUTION_CONTEXT = 'saveConflictResolutionContext';
30
30
  const CONFLICT_RESOLUTION_SCHEME = 'conflictResolution';
31
31
  const LEARN_MORE_DIRTY_WRITE_IGNORE_KEY = 'learnMoreDirtyWriteError';
32
- const conflictEditorHelp = ( localize(
33
- 'userGuide',
34
- "Use the actions in the editor tool bar to either undo your changes or overwrite the content of the file with your changes."
35
- ));
32
+ const conflictEditorHelp = localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'userGuide', "Use the actions in the editor tool bar to either undo your changes or overwrite the content of the file with your changes.");
36
33
  let TextFileSaveErrorHandler = class TextFileSaveErrorHandler extends Disposable {
37
34
  constructor(notificationService, textFileService, contextKeyService, editorService, textModelService, instantiationService, storageService) {
38
35
  super();
@@ -92,11 +89,7 @@ let TextFileSaveErrorHandler = class TextFileSaveErrorHandler extends Disposable
92
89
  secondaryActions.push(this.instantiationService.createInstance(DoNotShowResolveConflictLearnMoreAction));
93
90
  }
94
91
  else {
95
- message = ( localize(
96
- 'staleSaveError',
97
- "Failed to save '{0}': The content of the file is newer. Please compare your version with the file contents or overwrite the content of the file with your changes.",
98
- basename(resource)
99
- ));
92
+ message = localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'staleSaveError', "Failed to save '{0}': The content of the file is newer. Please compare your version with the file contents or overwrite the content of the file with your changes.", basename(resource));
100
93
  primaryActions.push(this.instantiationService.createInstance(ResolveSaveConflictAction, model));
101
94
  primaryActions.push(this.instantiationService.createInstance(SaveModelIgnoreModifiedSinceAction, model));
102
95
  secondaryActions.push(this.instantiationService.createInstance(ConfigureSaveConflictAction));
@@ -120,42 +113,17 @@ let TextFileSaveErrorHandler = class TextFileSaveErrorHandler extends Disposable
120
113
  primaryActions.push(this.instantiationService.createInstance(DiscardModelAction, model));
121
114
  if (isWriteLocked) {
122
115
  if (triedToUnlock && canSaveElevated) {
123
- message = isWindows ? ( localize(
124
- 'readonlySaveErrorAdmin',
125
- "Failed to save '{0}': File is read-only. Select 'Overwrite as Admin' to retry as administrator.",
126
- basename(resource)
127
- )) : ( localize(
128
- 'readonlySaveErrorSudo',
129
- "Failed to save '{0}': File is read-only. Select 'Overwrite as Sudo' to retry as superuser.",
130
- basename(resource)
131
- ));
116
+ message = isWindows ? localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'readonlySaveErrorAdmin', "Failed to save '{0}': File is read-only. Select 'Overwrite as Admin' to retry as administrator.", basename(resource)) : localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'readonlySaveErrorSudo', "Failed to save '{0}': File is read-only. Select 'Overwrite as Sudo' to retry as superuser.", basename(resource));
132
117
  }
133
118
  else {
134
- message = ( localize(
135
- 'readonlySaveError',
136
- "Failed to save '{0}': File is read-only. Select 'Overwrite' to attempt to make it writeable.",
137
- basename(resource)
138
- ));
119
+ message = localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'readonlySaveError', "Failed to save '{0}': File is read-only. Select 'Overwrite' to attempt to make it writeable.", basename(resource));
139
120
  }
140
121
  }
141
122
  else if (canSaveElevated && isPermissionDenied) {
142
- message = isWindows ? ( localize(
143
- 'permissionDeniedSaveError',
144
- "Failed to save '{0}': Insufficient permissions. Select 'Retry as Admin' to retry as administrator.",
145
- basename(resource)
146
- )) : ( localize(
147
- 'permissionDeniedSaveErrorSudo',
148
- "Failed to save '{0}': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.",
149
- basename(resource)
150
- ));
123
+ message = isWindows ? localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'permissionDeniedSaveError', "Failed to save '{0}': Insufficient permissions. Select 'Retry as Admin' to retry as administrator.", basename(resource)) : localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'permissionDeniedSaveErrorSudo', "Failed to save '{0}': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.", basename(resource));
151
124
  }
152
125
  else {
153
- message = ( localize(
154
- { key: 'genericSaveError', comment: ['{0} is the resource that failed to save and {1} the error message'] },
155
- "Failed to save '{0}': {1}",
156
- basename(resource),
157
- toErrorMessage(error, false)
158
- ));
126
+ message = localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', { key: 'genericSaveError', comment: ['{0} is the resource that failed to save and {1} the error message'] }, "Failed to save '{0}': {1}", basename(resource), toErrorMessage(error, false));
159
127
  }
160
128
  }
161
129
  const actions = { primary: primaryActions, secondary: secondaryActions };
@@ -184,7 +152,7 @@ TextFileSaveErrorHandler = ( __decorate([
184
152
  ], TextFileSaveErrorHandler));
185
153
  let ResolveConflictLearnMoreAction = class ResolveConflictLearnMoreAction extends Action {
186
154
  constructor(openerService) {
187
- super('workbench.files.action.resolveConflictLearnMore', ( localize('learnMore', "Learn More")));
155
+ super('workbench.files.action.resolveConflictLearnMore', localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'learnMore', "Learn More"));
188
156
  this.openerService = openerService;
189
157
  }
190
158
  async run() {
@@ -196,7 +164,7 @@ ResolveConflictLearnMoreAction = ( __decorate([
196
164
  ], ResolveConflictLearnMoreAction));
197
165
  let DoNotShowResolveConflictLearnMoreAction = class DoNotShowResolveConflictLearnMoreAction extends Action {
198
166
  constructor(storageService) {
199
- super('workbench.files.action.resolveConflictLearnMoreDoNotShowAgain', ( localize('dontShowAgain', "Don't Show Again")));
167
+ super('workbench.files.action.resolveConflictLearnMoreDoNotShowAgain', localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'dontShowAgain', "Don't Show Again"));
200
168
  this.storageService = storageService;
201
169
  }
202
170
  async run(notification) {
@@ -209,7 +177,7 @@ DoNotShowResolveConflictLearnMoreAction = ( __decorate([
209
177
  ], DoNotShowResolveConflictLearnMoreAction));
210
178
  let ResolveSaveConflictAction = class ResolveSaveConflictAction extends Action {
211
179
  constructor(model, editorService, notificationService, instantiationService, productService) {
212
- super('workbench.files.action.resolveConflict', ( localize('compareChanges', "Compare")));
180
+ super('workbench.files.action.resolveConflict', localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'compareChanges', "Compare"));
213
181
  this.model = model;
214
182
  this.editorService = editorService;
215
183
  this.notificationService = notificationService;
@@ -220,13 +188,7 @@ let ResolveSaveConflictAction = class ResolveSaveConflictAction extends Action {
220
188
  if (!this.model.isDisposed()) {
221
189
  const resource = this.model.resource;
222
190
  const name = basename(resource);
223
- const editorLabel = ( localize(
224
- 'saveConflictDiffLabel',
225
- "{0} (in file) ↔ {1} (in {2}) - Resolve save conflict",
226
- name,
227
- name,
228
- this.productService.nameLong
229
- ));
191
+ const editorLabel = localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'saveConflictDiffLabel', "{0} (in file) ↔ {1} (in {2}) - Resolve save conflict", name, name, this.productService.nameLong);
230
192
  await TextFileContentProvider.open(resource, CONFLICT_RESOLUTION_SCHEME, editorLabel, this.editorService, { pinned: true });
231
193
  const actions = { primary: [this.instantiationService.createInstance(ResolveConflictLearnMoreAction)] };
232
194
  const handle = this.notificationService.notify({
@@ -248,7 +210,7 @@ ResolveSaveConflictAction = ( __decorate([
248
210
  ], ResolveSaveConflictAction));
249
211
  class SaveModelElevatedAction extends Action {
250
212
  constructor(model, triedToUnlock) {
251
- super('workbench.files.action.saveModelElevated', triedToUnlock ? isWindows ? ( localize('overwriteElevated', "Overwrite as Admin...")) : ( localize('overwriteElevatedSudo', "Overwrite as Sudo...")) : isWindows ? ( localize('saveElevated', "Retry as Admin...")) : ( localize('saveElevatedSudo', "Retry as Sudo...")));
213
+ super('workbench.files.action.saveModelElevated', triedToUnlock ? isWindows ? localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'overwriteElevated', "Overwrite as Admin...") : localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'overwriteElevatedSudo', "Overwrite as Sudo...") : isWindows ? localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'saveElevated', "Retry as Admin...") : localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'saveElevatedSudo', "Retry as Sudo..."));
252
214
  this.model = model;
253
215
  this.triedToUnlock = triedToUnlock;
254
216
  }
@@ -264,7 +226,7 @@ class SaveModelElevatedAction extends Action {
264
226
  }
265
227
  class RetrySaveModelAction extends Action {
266
228
  constructor(model) {
267
- super('workbench.files.action.saveModel', ( localize('retry', "Retry")));
229
+ super('workbench.files.action.saveModel', localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'retry', "Retry"));
268
230
  this.model = model;
269
231
  }
270
232
  async run() {
@@ -275,7 +237,7 @@ class RetrySaveModelAction extends Action {
275
237
  }
276
238
  class DiscardModelAction extends Action {
277
239
  constructor(model) {
278
- super('workbench.files.action.discardModel', ( localize('discard', "Discard")));
240
+ super('workbench.files.action.discardModel', localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'discard', "Discard"));
279
241
  this.model = model;
280
242
  }
281
243
  async run() {
@@ -318,7 +280,7 @@ SaveModelAsAction = ( __decorate([
318
280
  ], SaveModelAsAction));
319
281
  class UnlockModelAction extends Action {
320
282
  constructor(model) {
321
- super('workbench.files.action.unlock', ( localize('overwrite', "Overwrite")));
283
+ super('workbench.files.action.unlock', localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'overwrite', "Overwrite"));
322
284
  this.model = model;
323
285
  }
324
286
  async run() {
@@ -329,7 +291,7 @@ class UnlockModelAction extends Action {
329
291
  }
330
292
  class SaveModelIgnoreModifiedSinceAction extends Action {
331
293
  constructor(model) {
332
- super('workbench.files.action.saveIgnoreModifiedSince', ( localize('overwrite', "Overwrite")));
294
+ super('workbench.files.action.saveIgnoreModifiedSince', localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'overwrite', "Overwrite"));
333
295
  this.model = model;
334
296
  }
335
297
  async run() {
@@ -340,7 +302,7 @@ class SaveModelIgnoreModifiedSinceAction extends Action {
340
302
  }
341
303
  let ConfigureSaveConflictAction = class ConfigureSaveConflictAction extends Action {
342
304
  constructor(preferencesService) {
343
- super('workbench.files.action.configureSaveConflict', ( localize('configure', "Configure")));
305
+ super('workbench.files.action.configureSaveConflict', localizeWithPath('vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler', 'configure', "Configure"));
344
306
  this.preferencesService = preferencesService;
345
307
  }
346
308
  async run() {
@@ -1,23 +1,34 @@
1
1
  import * as nls from 'monaco-editor/esm/vs/nls.js';
2
- import { renameHandler, moveFileToTrashHandler, deleteFileHandler, cutFileHandler, copyFileHandler, pasteFileHandler, openFilePreserveFocusHandler, NEW_FILE_LABEL, NEW_FILE_COMMAND_ID, NEW_FOLDER_LABEL, NEW_FOLDER_COMMAND_ID, COPY_FILE_LABEL, PASTE_FILE_LABEL, FileCopiedContext, DOWNLOAD_COMMAND_ID, DOWNLOAD_LABEL, UPLOAD_COMMAND_ID, UPLOAD_LABEL, TRIGGER_RENAME_LABEL, MOVE_FILE_TO_TRASH_LABEL } from 'vscode/vscode/vs/workbench/contrib/files/browser/fileActions';
2
+ import { GlobalCompareResourcesAction, FocusFilesExplorer, ShowActiveFileInExplorer, CompareWithClipboardAction, CompareNewUntitledTextFilesAction, ToggleAutoSaveAction, ShowOpenedFileInNewWindow, SetActiveEditorReadonlyInSession, SetActiveEditorWriteableInSession, ToggleActiveEditorReadonlyInSession, ResetActiveEditorReadonlyInSession, renameHandler, moveFileToTrashHandler, deleteFileHandler, cutFileHandler, copyFileHandler, pasteFileHandler, openFilePreserveFocusHandler, NEW_FILE_LABEL, NEW_FILE_COMMAND_ID, NEW_FOLDER_LABEL, NEW_FOLDER_COMMAND_ID, COPY_FILE_LABEL, PASTE_FILE_LABEL, FileCopiedContext, DOWNLOAD_COMMAND_ID, DOWNLOAD_LABEL, UPLOAD_COMMAND_ID, UPLOAD_LABEL, TRIGGER_RENAME_LABEL, MOVE_FILE_TO_TRASH_LABEL } from 'vscode/vscode/vs/workbench/contrib/files/browser/fileActions';
3
3
  import { CONFLICT_RESOLUTION_CONTEXT } from './editors/textFileSaveErrorHandler.js';
4
- import { MenuRegistry, MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
4
+ import { registerAction2, MenuRegistry, MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
5
5
  import './fileCommands.js';
6
- import { COPY_PATH_COMMAND_ID, COPY_RELATIVE_PATH_COMMAND_ID, REVEAL_IN_EXPLORER_COMMAND_ID, SAVE_FILE_LABEL, SAVE_FILE_COMMAND_ID, SAVE_FILE_WITHOUT_FORMATTING_LABEL, SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID, SAVE_ALL_IN_GROUP_COMMAND_ID, SAVE_FILES_COMMAND_ID, REVERT_FILE_COMMAND_ID, COMPARE_WITH_SAVED_COMMAND_ID, SAVE_FILE_AS_LABEL, SAVE_FILE_AS_COMMAND_ID, NEW_UNTITLED_FILE_LABEL, NEW_UNTITLED_FILE_COMMAND_ID, OPEN_TO_SIDE_COMMAND_ID, OpenEditorsDirtyEditorContext, OpenEditorsGroupContext, OpenEditorsReadonlyEditorContext, COMPARE_RESOURCE_COMMAND_ID, ResourceSelectedForCompareContext, SELECT_FOR_COMPARE_COMMAND_ID, COMPARE_SELECTED_COMMAND_ID, OPEN_WITH_EXPLORER_COMMAND_ID, REMOVE_ROOT_FOLDER_COMMAND_ID, REMOVE_ROOT_FOLDER_LABEL } from 'vscode/vscode/vs/workbench/contrib/files/browser/fileConstants';
6
+ import { COPY_PATH_COMMAND_ID, COPY_RELATIVE_PATH_COMMAND_ID, REVEAL_IN_EXPLORER_COMMAND_ID, SAVE_FILE_LABEL, SAVE_FILE_COMMAND_ID, SAVE_FILE_WITHOUT_FORMATTING_LABEL, SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID, SAVE_ALL_IN_GROUP_COMMAND_ID, SAVE_FILES_COMMAND_ID, REVERT_FILE_COMMAND_ID, COMPARE_WITH_SAVED_COMMAND_ID, SAVE_FILE_AS_LABEL, SAVE_FILE_AS_COMMAND_ID, NEW_UNTITLED_FILE_LABEL, NEW_UNTITLED_FILE_COMMAND_ID, OPEN_TO_SIDE_COMMAND_ID, OpenEditorsDirtyEditorContext, OpenEditorsGroupContext, OpenEditorsReadonlyEditorContext, COMPARE_RESOURCE_COMMAND_ID, ResourceSelectedForCompareContext, SELECT_FOR_COMPARE_COMMAND_ID, COMPARE_SELECTED_COMMAND_ID, OPEN_WITH_EXPLORER_COMMAND_ID, REMOVE_ROOT_FOLDER_COMMAND_ID, REMOVE_ROOT_FOLDER_LABEL, SAVE_ALL_COMMAND_ID } from 'vscode/vscode/vs/workbench/contrib/files/browser/fileConstants';
7
7
  import { ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
8
8
  import { KeybindingsRegistry } from 'monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js';
9
- import { FilesExplorerFocusCondition, ExplorerRootContext, ExplorerResourceNotReadonlyContext, ExplorerResourceMoveableToTrash, ExplorerResourceCut, ExplorerFolderContext, ExplorerResourceAvailableEditorIdsContext } from 'vscode/vscode/vs/workbench/contrib/files/common/files';
9
+ import { FilesExplorerFocusCondition, ExplorerRootContext, ExplorerResourceNotReadonlyContext, ExplorerResourceMoveableToTrash, ExplorerResourceCut, ExplorerFolderContext, ExplorerResourceAvailableEditorIdsContext, FoldersViewVisibleContext } from 'vscode/vscode/vs/workbench/contrib/files/common/files';
10
10
  import { ADD_ROOT_FOLDER_COMMAND_ID, ADD_ROOT_FOLDER_LABEL } from 'vscode/vscode/vs/workbench/browser/actions/workspaceCommands';
11
11
  import { REOPEN_WITH_COMMAND_ID, CLOSE_EDITOR_COMMAND_ID, CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID, CLOSE_SAVED_EDITORS_COMMAND_ID, CLOSE_EDITORS_IN_GROUP_COMMAND_ID } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorCommands';
12
12
  import { AutoSaveAfterShortDelayContext } from 'vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService';
13
13
  import { WorkbenchListDoubleSelection } from 'monaco-editor/esm/vs/platform/list/browser/listService.js';
14
14
  import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
15
- import { ResourceContextKey, WorkspaceFolderCountContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, HasWebFileSystemAccess, EnterMultiRootWorkspaceSupportContext, WorkbenchStateContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
15
+ import { ResourceContextKey, WorkspaceFolderCountContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, HasWebFileSystemAccess, EnterMultiRootWorkspaceSupportContext, WorkbenchStateContext, ActiveEditorContext, SidebarFocusContext, ActiveEditorCanRevertContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
16
16
  import { IsWebContext } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkeys.js';
17
17
  import { IExplorerService } from 'vscode/vscode/vs/workbench/contrib/files/browser/files';
18
18
  import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
19
19
  import { Categories } from 'monaco-editor/esm/vs/platform/action/common/actionCommonCategories.js';
20
20
 
21
+ registerAction2(GlobalCompareResourcesAction);
22
+ registerAction2(FocusFilesExplorer);
23
+ registerAction2(ShowActiveFileInExplorer);
24
+ registerAction2(CompareWithClipboardAction);
25
+ registerAction2(CompareNewUntitledTextFilesAction);
26
+ registerAction2(ToggleAutoSaveAction);
27
+ registerAction2(ShowOpenedFileInNewWindow);
28
+ registerAction2(SetActiveEditorReadonlyInSession);
29
+ registerAction2(SetActiveEditorWriteableInSession);
30
+ registerAction2(ToggleActiveEditorReadonlyInSession);
31
+ registerAction2(ResetActiveEditorReadonlyInSession);
21
32
  const explorerCommandsWeightBonus = 10;
22
33
  const RENAME_ID = 'renameFile';
23
34
  KeybindingsRegistry.registerCommandAndKeybindingRule({
@@ -114,15 +125,15 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
114
125
  });
115
126
  const copyPathCommand = {
116
127
  id: COPY_PATH_COMMAND_ID,
117
- title: ( nls.localize('copyPath', "Copy Path"))
128
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'copyPath', "Copy Path")
118
129
  };
119
130
  const copyRelativePathCommand = {
120
131
  id: COPY_RELATIVE_PATH_COMMAND_ID,
121
- title: ( nls.localize('copyRelativePath', "Copy Relative Path"))
132
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'copyRelativePath', "Copy Relative Path")
122
133
  };
123
134
  appendEditorTitleContextMenuItem(COPY_PATH_COMMAND_ID, copyPathCommand.title, ResourceContextKey.IsFileSystemResource, '1_cutcopypaste');
124
135
  appendEditorTitleContextMenuItem(COPY_RELATIVE_PATH_COMMAND_ID, copyRelativePathCommand.title, ResourceContextKey.IsFileSystemResource, '1_cutcopypaste');
125
- appendEditorTitleContextMenuItem(REVEAL_IN_EXPLORER_COMMAND_ID, ( nls.localize('revealInSideBar', "Reveal in Explorer View")), ResourceContextKey.IsFileSystemResource, '2_files', 1);
136
+ appendEditorTitleContextMenuItem(REVEAL_IN_EXPLORER_COMMAND_ID, nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'revealInSideBar', "Reveal in Explorer View"), ResourceContextKey.IsFileSystemResource, '2_files', 1);
126
137
  function appendEditorTitleContextMenuItem(id, title, when, group, order) {
127
138
  MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, {
128
139
  command: { id, title },
@@ -131,8 +142,8 @@ function appendEditorTitleContextMenuItem(id, title, when, group, order) {
131
142
  order
132
143
  });
133
144
  }
134
- appendSaveConflictEditorTitleAction('workbench.files.action.acceptLocalChanges', ( nls.localize('acceptLocalChanges', "Use your changes and overwrite file contents")), Codicon.check, -10);
135
- appendSaveConflictEditorTitleAction('workbench.files.action.revertLocalChanges', ( nls.localize('revertLocalChanges', "Discard your changes and revert to file contents")), Codicon.discard, -9);
145
+ appendSaveConflictEditorTitleAction('workbench.files.action.acceptLocalChanges', nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'acceptLocalChanges', "Use your changes and overwrite file contents"), Codicon.check, -10);
146
+ appendSaveConflictEditorTitleAction('workbench.files.action.revertLocalChanges', nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'revertLocalChanges', "Discard your changes and revert to file contents"), Codicon.discard, -9);
136
147
  function appendSaveConflictEditorTitleAction(id, title, icon, order, command) {
137
148
  MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
138
149
  command: { id, title, icon },
@@ -151,14 +162,14 @@ function appendToCommandPalette(id, title, category, when) {
151
162
  when
152
163
  });
153
164
  }
154
- appendToCommandPalette(COPY_PATH_COMMAND_ID, { value: ( nls.localize('copyPathOfActive', "Copy Path of Active File")), original: 'Copy Path of Active File' }, Categories.File);
155
- appendToCommandPalette(COPY_RELATIVE_PATH_COMMAND_ID, { value: ( nls.localize('copyRelativePathOfActive', "Copy Relative Path of Active File")), original: 'Copy Relative Path of Active File' }, Categories.File);
165
+ appendToCommandPalette(COPY_PATH_COMMAND_ID, { value: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'copyPathOfActive', "Copy Path of Active File"), original: 'Copy Path of Active File' }, Categories.File);
166
+ appendToCommandPalette(COPY_RELATIVE_PATH_COMMAND_ID, { value: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'copyRelativePathOfActive', "Copy Relative Path of Active File"), original: 'Copy Relative Path of Active File' }, Categories.File);
156
167
  appendToCommandPalette(SAVE_FILE_COMMAND_ID, { value: SAVE_FILE_LABEL, original: 'Save' }, Categories.File);
157
168
  appendToCommandPalette(SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID, { value: SAVE_FILE_WITHOUT_FORMATTING_LABEL, original: 'Save without Formatting' }, Categories.File);
158
- appendToCommandPalette(SAVE_ALL_IN_GROUP_COMMAND_ID, { value: ( nls.localize('saveAllInGroup', "Save All in Group")), original: 'Save All in Group' }, Categories.File);
159
- appendToCommandPalette(SAVE_FILES_COMMAND_ID, { value: ( nls.localize('saveFiles', "Save All Files")), original: 'Save All Files' }, Categories.File);
160
- appendToCommandPalette(REVERT_FILE_COMMAND_ID, { value: ( nls.localize('revert', "Revert File")), original: 'Revert File' }, Categories.File);
161
- appendToCommandPalette(COMPARE_WITH_SAVED_COMMAND_ID, { value: ( nls.localize('compareActiveWithSaved', "Compare Active File with Saved")), original: 'Compare Active File with Saved' }, Categories.File);
169
+ appendToCommandPalette(SAVE_ALL_IN_GROUP_COMMAND_ID, { value: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'saveAllInGroup', "Save All in Group"), original: 'Save All in Group' }, Categories.File);
170
+ appendToCommandPalette(SAVE_FILES_COMMAND_ID, { value: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'saveFiles', "Save All Files"), original: 'Save All Files' }, Categories.File);
171
+ appendToCommandPalette(REVERT_FILE_COMMAND_ID, { value: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'revert', "Revert File"), original: 'Revert File' }, Categories.File);
172
+ appendToCommandPalette(COMPARE_WITH_SAVED_COMMAND_ID, { value: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'compareActiveWithSaved', "Compare Active File with Saved"), original: 'Compare Active File with Saved' }, Categories.File);
162
173
  appendToCommandPalette(SAVE_FILE_AS_COMMAND_ID, { value: SAVE_FILE_AS_LABEL, original: 'Save As...' }, Categories.File);
163
174
  appendToCommandPalette(NEW_FILE_COMMAND_ID, { value: NEW_FILE_LABEL, original: 'New File' }, Categories.File, ( WorkspaceFolderCountContext.notEqualsTo('0')));
164
175
  appendToCommandPalette(NEW_FOLDER_COMMAND_ID, { value: NEW_FOLDER_LABEL, original: 'New Folder' }, Categories.File, ( WorkspaceFolderCountContext.notEqualsTo('0')));
@@ -166,7 +177,7 @@ appendToCommandPalette(NEW_UNTITLED_FILE_COMMAND_ID, { value: NEW_UNTITLED_FILE_
166
177
  const isFileOrUntitledResourceContextKey = ( ContextKeyExpr.or(ResourceContextKey.IsFileSystemResource, ( ResourceContextKey.Scheme.isEqualTo(Schemas.untitled))));
167
178
  const openToSideCommand = {
168
179
  id: OPEN_TO_SIDE_COMMAND_ID,
169
- title: ( nls.localize('openToSide', "Open to the Side"))
180
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'openToSide', "Open to the Side")
170
181
  };
171
182
  MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
172
183
  group: 'navigation',
@@ -179,7 +190,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
179
190
  order: 10,
180
191
  command: {
181
192
  id: REOPEN_WITH_COMMAND_ID,
182
- title: ( nls.localize('reopenWith', "Reopen Editor With..."))
193
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'reopenWith', "Reopen Editor With...")
183
194
  },
184
195
  when: ActiveEditorAvailableEditorIdsContext
185
196
  });
@@ -215,7 +226,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
215
226
  order: 20,
216
227
  command: {
217
228
  id: REVERT_FILE_COMMAND_ID,
218
- title: ( nls.localize('revert', "Revert File")),
229
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'revert', "Revert File"),
219
230
  precondition: OpenEditorsDirtyEditorContext
220
231
  },
221
232
  when: ( ContextKeyExpr.and((
@@ -229,7 +240,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
229
240
  order: 30,
230
241
  command: {
231
242
  id: SAVE_ALL_IN_GROUP_COMMAND_ID,
232
- title: ( nls.localize('saveAll', "Save All")),
243
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'saveAll', "Save All"),
233
244
  precondition: DirtyWorkingCopiesContext
234
245
  },
235
246
  when: OpenEditorsGroupContext
@@ -239,14 +250,14 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
239
250
  order: 10,
240
251
  command: {
241
252
  id: COMPARE_WITH_SAVED_COMMAND_ID,
242
- title: ( nls.localize('compareWithSaved', "Compare with Saved")),
253
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'compareWithSaved', "Compare with Saved"),
243
254
  precondition: OpenEditorsDirtyEditorContext
244
255
  },
245
256
  when: ( ContextKeyExpr.and(ResourceContextKey.IsFileSystemResource, ( AutoSaveAfterShortDelayContext.toNegated()), ( WorkbenchListDoubleSelection.toNegated())))
246
257
  });
247
258
  const compareResourceCommand = {
248
259
  id: COMPARE_RESOURCE_COMMAND_ID,
249
- title: ( nls.localize('compareWithSelected', "Compare with Selected"))
260
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'compareWithSelected', "Compare with Selected")
250
261
  };
251
262
  MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
252
263
  group: '3_compare',
@@ -261,7 +272,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
261
272
  });
262
273
  const selectForCompareCommand = {
263
274
  id: SELECT_FOR_COMPARE_COMMAND_ID,
264
- title: ( nls.localize('compareSource', "Select for Compare"))
275
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'compareSource', "Select for Compare")
265
276
  };
266
277
  MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
267
278
  group: '3_compare',
@@ -275,7 +286,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
275
286
  });
276
287
  const compareSelectedCommand = {
277
288
  id: COMPARE_SELECTED_COMMAND_ID,
278
- title: ( nls.localize('compareSelected', "Compare Selected"))
289
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'compareSelected', "Compare Selected")
279
290
  };
280
291
  MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
281
292
  group: '3_compare',
@@ -292,7 +303,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
292
303
  order: 10,
293
304
  command: {
294
305
  id: CLOSE_EDITOR_COMMAND_ID,
295
- title: ( nls.localize('close', "Close"))
306
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'close', "Close")
296
307
  },
297
308
  when: ( OpenEditorsGroupContext.toNegated())
298
309
  });
@@ -301,7 +312,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
301
312
  order: 20,
302
313
  command: {
303
314
  id: CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID,
304
- title: ( nls.localize('closeOthers', "Close Others"))
315
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'closeOthers', "Close Others")
305
316
  },
306
317
  when: ( OpenEditorsGroupContext.toNegated())
307
318
  });
@@ -310,7 +321,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
310
321
  order: 30,
311
322
  command: {
312
323
  id: CLOSE_SAVED_EDITORS_COMMAND_ID,
313
- title: ( nls.localize('closeSaved', "Close Saved"))
324
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'closeSaved', "Close Saved")
314
325
  }
315
326
  });
316
327
  MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
@@ -318,7 +329,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
318
329
  order: 40,
319
330
  command: {
320
331
  id: CLOSE_EDITORS_IN_GROUP_COMMAND_ID,
321
- title: ( nls.localize('closeAll', "Close All"))
332
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'closeAll', "Close All")
322
333
  }
323
334
  });
324
335
  MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
@@ -352,7 +363,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
352
363
  order: 20,
353
364
  command: {
354
365
  id: OPEN_WITH_EXPLORER_COMMAND_ID,
355
- title: ( nls.localize('explorerOpenWith', "Open With...")),
366
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'explorerOpenWith', "Open With..."),
356
367
  },
357
368
  when: ( ContextKeyExpr.and(( ExplorerFolderContext.toNegated()), ExplorerResourceAvailableEditorIdsContext)),
358
369
  });
@@ -379,7 +390,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
379
390
  order: 8,
380
391
  command: {
381
392
  id: CUT_FILE_ID,
382
- title: ( nls.localize('cut', "Cut"))
393
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'cut', "Cut")
383
394
  },
384
395
  when: ( ContextKeyExpr.and(( ExplorerRootContext.toNegated()), ExplorerResourceNotReadonlyContext))
385
396
  });
@@ -476,7 +487,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
476
487
  },
477
488
  alt: {
478
489
  id: DELETE_FILE_ID,
479
- title: ( nls.localize('deleteFile', "Delete Permanently")),
490
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'deleteFile', "Delete Permanently"),
480
491
  precondition: ExplorerResourceNotReadonlyContext
481
492
  },
482
493
  when: ( ContextKeyExpr.and(( ExplorerRootContext.toNegated()), ExplorerResourceMoveableToTrash))
@@ -486,23 +497,84 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
486
497
  order: 20,
487
498
  command: {
488
499
  id: DELETE_FILE_ID,
489
- title: ( nls.localize('deleteFile', "Delete Permanently")),
500
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'deleteFile', "Delete Permanently"),
490
501
  precondition: ExplorerResourceNotReadonlyContext
491
502
  },
492
503
  when: ( ContextKeyExpr.and(( ExplorerRootContext.toNegated()), ( ExplorerResourceMoveableToTrash.toNegated())))
493
504
  });
494
505
  for (const menuId of [MenuId.EmptyEditorGroupContext, MenuId.EditorTabsBarContext]) {
495
- MenuRegistry.appendMenuItem(menuId, { command: { id: NEW_UNTITLED_FILE_COMMAND_ID, title: ( nls.localize('newFile', "New Text File")) }, group: '1_file', order: 10 });
496
- MenuRegistry.appendMenuItem(menuId, { command: { id: 'workbench.action.quickOpen', title: ( nls.localize('openFile', "Open File...")) }, group: '1_file', order: 20 });
506
+ MenuRegistry.appendMenuItem(menuId, { command: { id: NEW_UNTITLED_FILE_COMMAND_ID, title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'newFile', "New Text File") }, group: '1_file', order: 10 });
507
+ MenuRegistry.appendMenuItem(menuId, { command: { id: 'workbench.action.quickOpen', title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', 'openFile', "Open File...") }, group: '1_file', order: 20 });
497
508
  }
509
+ ( MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
510
+ group: '1_new',
511
+ command: {
512
+ id: NEW_UNTITLED_FILE_COMMAND_ID,
513
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', { key: 'miNewFile', comment: ['&& denotes a mnemonic'] }, "&&New Text File")
514
+ },
515
+ order: 1
516
+ }));
517
+ ( MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
518
+ group: '4_save',
519
+ command: {
520
+ id: SAVE_FILE_COMMAND_ID,
521
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', { key: 'miSave', comment: ['&& denotes a mnemonic'] }, "&&Save"),
522
+ precondition: ( ContextKeyExpr.or(ActiveEditorContext, ( ContextKeyExpr.and(FoldersViewVisibleContext, SidebarFocusContext))))
523
+ },
524
+ order: 1
525
+ }));
526
+ ( MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
527
+ group: '4_save',
528
+ command: {
529
+ id: SAVE_FILE_AS_COMMAND_ID,
530
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', { key: 'miSaveAs', comment: ['&& denotes a mnemonic'] }, "Save &&As..."),
531
+ precondition: ( ContextKeyExpr.or(ActiveEditorContext, ( ContextKeyExpr.and(FoldersViewVisibleContext, SidebarFocusContext))))
532
+ },
533
+ order: 2
534
+ }));
535
+ ( MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
536
+ group: '4_save',
537
+ command: {
538
+ id: SAVE_ALL_COMMAND_ID,
539
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', { key: 'miSaveAll', comment: ['&& denotes a mnemonic'] }, "Save A&&ll"),
540
+ precondition: DirtyWorkingCopiesContext
541
+ },
542
+ order: 3
543
+ }));
544
+ ( MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
545
+ group: '5_autosave',
546
+ command: {
547
+ id: ToggleAutoSaveAction.ID,
548
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', { key: 'miAutoSave', comment: ['&& denotes a mnemonic'] }, "A&&uto Save"),
549
+ toggled: ( ContextKeyExpr.notEquals('config.files.autoSave', 'off'))
550
+ },
551
+ order: 1
552
+ }));
553
+ ( MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
554
+ group: '6_close',
555
+ command: {
556
+ id: REVERT_FILE_COMMAND_ID,
557
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', { key: 'miRevert', comment: ['&& denotes a mnemonic'] }, "Re&&vert File"),
558
+ precondition: ( ContextKeyExpr.or((
559
+ ContextKeyExpr.and(ActiveEditorCanRevertContext)), (
560
+ ContextKeyExpr.and(( ResourceContextKey.Scheme.notEqualsTo(Schemas.untitled)), FoldersViewVisibleContext, SidebarFocusContext)))),
561
+ },
562
+ order: 1
563
+ }));
564
+ ( MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
565
+ group: '6_close',
566
+ command: {
567
+ id: CLOSE_EDITOR_COMMAND_ID,
568
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', { key: 'miCloseEditor', comment: ['&& denotes a mnemonic'] }, "&&Close Editor"),
569
+ precondition: ( ContextKeyExpr.or(ActiveEditorContext, ( ContextKeyExpr.and(FoldersViewVisibleContext, SidebarFocusContext))))
570
+ },
571
+ order: 2
572
+ }));
498
573
  MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
499
574
  group: '3_global_nav',
500
575
  command: {
501
576
  id: 'workbench.action.quickOpen',
502
- title: ( nls.localize(
503
- { key: 'miGotoFile', comment: ['&& denotes a mnemonic'] },
504
- "Go to &&File..."
505
- ))
577
+ title: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileActions.contribution', { key: 'miGotoFile', comment: ['&& denotes a mnemonic'] }, "Go to &&File...")
506
578
  },
507
579
  order: 1
508
580
  });
@@ -117,7 +117,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
117
117
  const uri = getResourceForCommand(resource, accessor.get(IListService), editorService);
118
118
  if (uri && fileService.hasProvider(uri)) {
119
119
  const name = basename(uri);
120
- const editorLabel = ( nls.localize('modifiedLabel', "{0} (in file) ↔ {1}", name, name));
120
+ const editorLabel = nls.localizeWithPath('vs/workbench/contrib/files/browser/fileCommands', 'modifiedLabel', "{0} (in file) ↔ {1}", name, name);
121
121
  try {
122
122
  await TextFileContentProvider.open(uri, COMPARE_WITH_SAVED_SCHEMA, editorLabel, editorService, { pinned: true });
123
123
  if (registerEditorListener) {
@@ -353,16 +353,11 @@ async function doSaveEditors(accessor, editors, options) {
353
353
  notificationService.notify({
354
354
  id: ( editors.map(({ editor }) => hash(editor.resource?.toString()))).join(),
355
355
  severity: Severity.Error,
356
- message: ( nls.localize(
357
- { key: 'genericSaveError', comment: ['{0} is the resource that failed to save and {1} the error message'] },
358
- "Failed to save '{0}': {1}",
359
- ( editors.map(({ editor }) => editor.getName())).join(', '),
360
- toErrorMessage(error, false)
361
- )),
356
+ message: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileCommands', { key: 'genericSaveError', comment: ['{0} is the resource that failed to save and {1} the error message'] }, "Failed to save '{0}': {1}", ( editors.map(({ editor }) => editor.getName())).join(', '), toErrorMessage(error, false)),
362
357
  actions: {
363
358
  primary: [
364
- toAction({ id: 'workbench.action.files.saveEditors', label: ( nls.localize('retry', "Retry")), run: () => instantiationService.invokeFunction(accessor => doSaveEditors(accessor, editors, options)) }),
365
- toAction({ id: 'workbench.action.files.revertEditors', label: ( nls.localize('discard', "Discard")), run: () => editorService.revert(editors) })
359
+ toAction({ id: 'workbench.action.files.saveEditors', label: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileCommands', 'retry', "Retry"), run: () => instantiationService.invokeFunction(accessor => doSaveEditors(accessor, editors, options)) }),
360
+ toAction({ id: 'workbench.action.files.revertEditors', label: nls.localizeWithPath('vs/workbench/contrib/files/browser/fileCommands', 'discard', "Discard"), run: () => editorService.revert(editors) })
366
361
  ]
367
362
  }
368
363
  });
@@ -452,7 +447,7 @@ CommandsRegistry.registerCommand({
452
447
  await editorService.revert(editors.filter(({ editor }) => !editor.hasCapability(4 ) ), { force: true });
453
448
  }
454
449
  catch (error) {
455
- notificationService.error(( nls.localize('genericRevertError', "Failed to revert '{0}': {1}", ( editors.map(({ editor }) => editor.getName())).join(', '), toErrorMessage(error, false))));
450
+ notificationService.error(nls.localizeWithPath('vs/workbench/contrib/files/browser/fileCommands', 'genericRevertError', "Failed to revert '{0}': {1}", ( editors.map(({ editor }) => editor.getName())).join(', '), toErrorMessage(error, false)));
456
451
  }
457
452
  }
458
453
  });
@@ -597,7 +592,7 @@ CommandsRegistry.registerCommand({
597
592
  const editorService = accessor.get(IEditorService);
598
593
  const dialogService = accessor.get(IFileDialogService);
599
594
  const fileService = accessor.get(IFileService);
600
- const createFileLocalized = ( nls.localize('newFileCommand.saveLabel', "Create File"));
595
+ const createFileLocalized = nls.localizeWithPath('vs/workbench/contrib/files/browser/fileCommands', 'newFileCommand.saveLabel', "Create File");
601
596
  const defaultFileUri = joinPath(await dialogService.defaultFilePath(), args?.fileName ?? 'Untitled.txt');
602
597
  const saveUri = await dialogService.showSaveDialog({ saveLabel: createFileLocalized, title: createFileLocalized, defaultUri: defaultFileUri });
603
598
  if (!saveUri) {