diff options
Diffstat (limited to 'src/vs')
-rw-r--r-- | src/vs/workbench/electron-sandbox/window.ts | 57 |
1 files changed, 2 insertions, 55 deletions
diff --git a/src/vs/workbench/electron-sandbox/window.ts b/src/vs/workbench/electron-sandbox/window.ts index 0d197e84c16..f044363676a 100644 --- a/src/vs/workbench/electron-sandbox/window.ts +++ b/src/vs/workbench/electron-sandbox/window.ts @@ -65,7 +65,6 @@ import { toErrorMessage } from 'vs/base/common/errorMessage'; import { registerWindowDriver } from 'vs/platform/driver/electron-sandbox/driver'; import { ILabelService } from 'vs/platform/label/common/label'; import { dirname } from 'vs/base/common/resources'; -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; export class NativeWindow extends Disposable { @@ -116,8 +115,7 @@ export class NativeWindow extends Disposable { @IInstantiationService private readonly instantiationService: IInstantiationService, @ISharedProcessService private readonly sharedProcessService: ISharedProcessService, @IProgressService private readonly progressService: IProgressService, - @ILabelService private readonly labelService: ILabelService, - @IUriIdentityService private readonly uriIdentityService: IUriIdentityService + @ILabelService private readonly labelService: ILabelService ) { super(); @@ -131,18 +129,7 @@ export class NativeWindow extends Disposable { this._register(addDisposableListener(window, EventType.RESIZE, e => this.onWindowResize(e, true))); // React to editor input changes - const appRootUri = URI.file(this.environmentService.appRoot); - this._register(this.editorService.onDidActiveEditorChange(() => { - - // Touchbar - this.updateTouchbarMenu(); - - // Potential data loss when editing files - // from within the installation app root - if (this.environmentService.isBuilt) { - this.notifyOnAppRootEditors(appRootUri); - } - })); + this._register(this.editorService.onDidActiveEditorChange(() => this.updateTouchbarMenu())); // prevent opening a real URL inside the window for (const event of [EventType.DRAG_OVER, EventType.DROP]) { @@ -808,46 +795,6 @@ export class NativeWindow extends Disposable { } } - private notifyOnAppRootEditors(appRootUri: URI): void { - const resourceUri = EditorResourceAccessor.getOriginalUri(this.editorService.activeEditor, { supportSideBySide: SideBySideEditor.BOTH }); - const isResourceAppRootedFn = (uri: URI): boolean => this.uriIdentityService.extUri.isEqualOrParent(uri, appRootUri); - let isResourceAppRooted = false; - if (URI.isUri(resourceUri)) { - if (isResourceAppRootedFn(resourceUri)) { - isResourceAppRooted = true; - } - } else if (resourceUri) { - if (resourceUri.primary && isResourceAppRootedFn(resourceUri.primary)) { - isResourceAppRooted = true; - } else if (resourceUri.secondary && isResourceAppRootedFn(resourceUri.secondary)) { - isResourceAppRooted = true; - } - } - - // It is dangerous to edit files in the installation directory of Code because - // an update will remove all files and replace them with the new version. - // As such, we notify the user whenever an editor opens that is located somewhere - // in the installation directory. - // https://github.com/microsoft/vscode/issues/138815 - - if (isResourceAppRooted) { - this.notificationService.prompt( - Severity.Warning, - localize('notifyOnAppRootEditors', "Files within the installation folder of '{0}' ({1}) will be OVERWRITTEN or DELETED IRREVERSIBLY without warning during a future update.", this.productService.nameShort, this.environmentService.appRoot), - [{ - label: localize('understood', 'Understood'), - run: async () => { - // Nothing to do - } - }], - { - neverShowAgain: { id: 'window.notifyOnAppRootEditors', isSecondary: true }, - sticky: true - } - ); - } - } - private onAddFoldersRequest(request: IAddFoldersRequest): void { // Buffer all pending requests |