Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/vs
diff options
context:
space:
mode:
authorBenjamin Pasero <benjamin.pasero@microsoft.com>2022-07-28 07:11:05 +0300
committerGitHub <noreply@github.com>2022-07-28 07:11:05 +0300
commit3e26d50f995f4ed76adedff0138138b29b958625 (patch)
tree60f1ecaf92e08518ff63b3d8372ffe14bc225141 /src/vs
parent0e5245ccc780813981650fc7bb3fa854e423b5d1 (diff)
Revert "Warn user when they open a file within the install folder tree (#138815) (#155443)" (#156403)
This reverts commit 688c30e498f16686cc0c681e9fdc65d770b2c69a.
Diffstat (limited to 'src/vs')
-rw-r--r--src/vs/workbench/electron-sandbox/window.ts57
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