Skip to content

Commit fd581d7

Browse files
committed
fixup!: update patch
1 parent 491d43a commit fd581d7

File tree

1 file changed

+37
-17
lines changed

1 file changed

+37
-17
lines changed

patches/disable-downloads.diff

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,19 @@ Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/envi
2828
===================================================================
2929
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
3030
+++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
31-
@@ -61,6 +61,13 @@ export class BrowserWorkbenchEnvironment
31+
@@ -30,6 +30,11 @@ export interface IBrowserWorkbenchEnviro
32+
* Options used to configure the workbench.
33+
*/
34+
readonly options?: IWorkbenchConstructionOptions;
35+
+
36+
+ /**
37+
+ * Enable downloading files via menu actions.
38+
+ */
39+
+ readonly isEnabledFileDownloads?: boolean;
40+
}
41+
42+
export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvironmentService {
43+
@@ -61,6 +66,13 @@ export class BrowserWorkbenchEnvironment
3244
return this.options.userDataPath;
3345
}
3446

@@ -78,7 +90,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
7890
===================================================================
7991
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
8092
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
81-
@@ -7,7 +7,7 @@ import { Event } from 'vs/base/common/ev
93+
@@ -7,12 +7,11 @@ import { Event } from 'vs/base/common/ev
8294
import { Disposable } from 'vs/base/common/lifecycle';
8395
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
8496
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext } from 'vs/platform/contextkey/common/contextkeys';
@@ -87,30 +99,38 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
8799
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION } from 'vs/workbench/common/editor';
88100
import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom';
89101
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
102+
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
103+
-import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
104+
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
105+
import { WorkbenchState, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
106+
import { IWorkbenchLayoutService, Parts, positionToString } from 'vs/workbench/services/layout/browser/layoutService';
107+
@@ -24,6 +23,7 @@ import { IEditorResolverService } from '
108+
import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite';
109+
import { Schemas } from 'vs/base/common/network';
110+
import { WebFileSystemAccess } from 'vs/platform/files/browser/webFileSystemAccess';
111+
+import { IBrowserWorkbenchEnvironmentService } from '../services/environment/browser/environmentService';
112+
113+
export class WorkbenchContextKeysHandler extends Disposable {
114+
private inputFocusedContext: IContextKey<boolean>;
115+
@@ -75,7 +75,7 @@ export class WorkbenchContextKeysHandler
116+
@IContextKeyService private readonly contextKeyService: IContextKeyService,
117+
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
118+
@IConfigurationService private readonly configurationService: IConfigurationService,
119+
- @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
120+
+ @IBrowserWorkbenchEnvironmentService private readonly environmentService: IBrowserWorkbenchEnvironmentService,
121+
@IEditorService private readonly editorService: IEditorService,
122+
@IEditorResolverService private readonly editorResolverService: IEditorResolverService,
123+
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService,
90124
@@ -194,6 +194,9 @@ export class WorkbenchContextKeysHandler
91125
this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService);
92126
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
93127

94128
+ // code-server
95-
+ IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads)
129+
+ IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
96130
+
97131
this.registerListeners();
98132
}
99133

100-
Index: code-server/lib/vscode/src/vs/workbench/services/environment/common/environmentService.ts
101-
===================================================================
102-
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/common/environmentService.ts
103-
+++ code-server/lib/vscode/src/vs/workbench/services/environment/common/environmentService.ts
104-
@@ -44,6 +44,9 @@ export interface IWorkbenchEnvironmentSe
105-
readonly filesToOpenOrCreate?: IPath[] | undefined;
106-
readonly filesToDiff?: IPath[] | undefined;
107-
108-
+ // --- code-server
109-
+ readonly isEnabledFileDownloads: boolean;
110-
+
111-
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
112-
// NOTE: KEEP THIS INTERFACE AS SMALL AS POSSIBLE. AS SUCH:
113-
// - PUT NON-WEB PROPERTIES INTO NATIVE WB ENV SERVICE
114134
Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
115135
===================================================================
116136
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts

0 commit comments

Comments
 (0)