Skip to content

Commit 0edf6bb

Browse files
Merge pull request #171 from aws/feature/base-path-compatibility
Fix base-path-compatibility patch for VS Code 1.100.2
2 parents 4b3f8dd + fd0a2b0 commit 0edf6bb

File tree

2 files changed

+32
-26
lines changed

2 files changed

+32
-26
lines changed

patched-vscode/src/vs/server/node/serverEnvironmentService.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,18 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import * as nls from 'vs/nls';
6+
import * as nls from '../../nls.js';
77

8-
import { NativeEnvironmentService } from 'vs/platform/environment/node/environmentService';
9-
import { OPTIONS, OptionDescriptions } from 'vs/platform/environment/node/argv';
10-
import { refineServiceDecorator } from 'vs/platform/instantiation/common/instantiation';
11-
import { IEnvironmentService, INativeEnvironmentService } from 'vs/platform/environment/common/environment';
12-
import { IProductService } from 'vs/platform/product/common/productService';
13-
import { memoize } from 'vs/base/common/decorators';
14-
import { URI } from 'vs/base/common/uri';
8+
import { NativeEnvironmentService } from '../../platform/environment/node/environmentService.js';
9+
import { OPTIONS, OptionDescriptions } from '../../platform/environment/node/argv.js';
10+
import { refineServiceDecorator } from '../../platform/instantiation/common/instantiation.js';
11+
import { IEnvironmentService, INativeEnvironmentService } from '../../platform/environment/common/environment.js';
12+
import { IProductService } from '../../platform/product/common/productService.js';
13+
import { memoize } from '../../base/common/decorators.js';
14+
import { URI } from '../../base/common/uri.js';
1515

1616
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
1717

18-
'locale': { type: 'string' },
19-
2018
/* ----- server setup ----- */
2119

2220
'host': { type: 'string', cat: 'o', args: 'ip-address', description: nls.localize('host', "The host name or IP address the server should listen to. If not set, defaults to 'localhost'.") },
@@ -43,6 +41,7 @@ export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
4341
'log': OPTIONS['log'],
4442
'logsPath': OPTIONS['logsPath'],
4543
'force-disable-user-env': OPTIONS['force-disable-user-env'],
44+
'enable-proposed-api': OPTIONS['enable-proposed-api'],
4645

4746
/* ----- vs code web options ----- */
4847

@@ -72,6 +71,7 @@ export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
7271
'category': OPTIONS['category'],
7372
'force': OPTIONS['force'],
7473
'do-not-sync': OPTIONS['do-not-sync'],
74+
'do-not-include-pack-dependencies': OPTIONS['do-not-include-pack-dependencies'],
7575
'pre-release': OPTIONS['pre-release'],
7676
'start-server': { type: 'boolean', cat: 'e', description: nls.localize('start-server', "Start the server when installing or uninstalling extensions. To be used in combination with 'install-extension', 'install-builtin-extension' and 'uninstall-extension'.") },
7777

@@ -100,8 +100,6 @@ export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
100100

101101
export interface ServerParsedArgs {
102102

103-
'locale'?: string;
104-
105103
/* ----- server setup ----- */
106104

107105
host?: string;
@@ -170,6 +168,7 @@ export interface ServerParsedArgs {
170168
'logsPath'?: string;
171169

172170
'force-disable-user-env'?: boolean;
171+
'enable-proposed-api'?: string[];
173172

174173
/* ----- vs code web options ----- */
175174

@@ -202,6 +201,8 @@ export interface ServerParsedArgs {
202201
force?: boolean; // used by install-extension
203202
'do-not-sync'?: boolean; // used by install-extension
204203
'pre-release'?: boolean; // used by install-extension
204+
'do-not-include-pack-dependencies'?: boolean; // used by install-extension
205+
205206

206207
'start-server'?: boolean;
207208

@@ -246,4 +247,4 @@ export class ServerEnvironmentService extends NativeEnvironmentService implement
246247
@memoize
247248
override get userRoamingDataHome(): URI { return this.appSettingsHome; }
248249
override get args(): ServerParsedArgs { return super.args as ServerParsedArgs; }
249-
}
250+
}

patches/base-path-compatibility.diff

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,39 @@ Index: sagemaker-code-editor/vscode/src/vs/server/node/serverEnvironmentService.
22
===================================================================
33
--- sagemaker-code-editor.orig/vscode/src/vs/server/node/serverEnvironmentService.ts
44
+++ sagemaker-code-editor/vscode/src/vs/server/node/serverEnvironmentService.ts
5-
@@ -11,6 +11,7 @@ import { OPTIONS, OptionDescriptions } from 'vs/platform/environment/node/argv'
6-
import { refineServiceDecorator } from 'vs/platform/instantiation/common/instantiation';
7-
import { IEnvironmentService, INativeEnvironmentService } from 'vs/platform/environment/common/environment';
8-
+import { IProductService } from 'vs/platform/product/common/productService';
9-
import { memoize } from 'vs/base/common/decorators';
10-
import { URI } from 'vs/base/common/uri';
5+
@@ -9,6 +9,7 @@
6+
import { OPTIONS, OptionDescriptions } from '../../platform/environment/node/argv.js';
7+
import { refineServiceDecorator } from '../../platform/instantiation/common/instantiation.js';
8+
import { IEnvironmentService, INativeEnvironmentService } from '../../platform/environment/common/environment.js';
9+
+import { IProductService } from '../../platform/product/common/productService.js';
10+
import { memoize } from '../../base/common/decorators.js';
11+
import { URI } from '../../base/common/uri.js';
1112

12-
@@ -89,6 +90,9 @@ export const serverOptions: OptionDescri
13+
@@ -91,6 +92,9 @@
1314

1415
'compatibility': { type: 'string' },
1516

16-
+ /* ----- sagemaker compatibility ----- */
17+
+ /* ----- sagemaker ----- */
1718
+ 'base-path': { type: 'string' },
1819
+
1920
_: OPTIONS['_']
2021
};
2122

22-
@@ -212,6 +215,9 @@ export interface ServerParsedArgs {
23+
@@ -217,6 +221,9 @@
2324

2425
compatibility: string;
2526

26-
+ /* ----- sagemaker compatibility ----- */
27+
+ /* ----- sagemaker ----- */
2728
+ 'base-path'?: string,
2829
+
2930
_: string[];
3031
}
3132

32-
@@ -234,6 +240,12 @@ export interface IServerEnvironmentService extends INativeEnvironmentService {
33+
@@ -227,7 +234,17 @@
34+
}
3335

3436
export class ServerEnvironmentService extends NativeEnvironmentService implements IServerEnvironmentService {
35-
37+
+
3638
+ constructor(args: ServerParsedArgs, productService: IProductService) {
3739
+ /* ----- sagemaker compatibility: map --base-path to --server-base-path ----- */
3840
+ if (args['base-path']) {
@@ -44,4 +46,7 @@ Index: sagemaker-code-editor/vscode/src/vs/server/node/serverEnvironmentService.
4446
+
4547
@memoize
4648
override get userRoamingDataHome(): URI { return this.appSettingsHome; }
47-
override get args(): ServerParsedArgs { return super.args as ServerParsedArgs; }
49+
override get args(): ServerParsedArgs { return super.args as ServerParsedArgs; }
50+
-}
51+
+}
52+
\ No newline at end of file

0 commit comments

Comments
 (0)