Skip to content

Commit 0ef0c9f

Browse files
svenefftingeroboquat
authored andcommitted
[server] Disable inference of extensions
1 parent f8151d2 commit 0ef0c9f

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

components/server/src/config/config-inferrer.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { WorkspaceConfig } from "@gitpod/gitpod-protocol";
1111

1212
function context(files: {[path:string]:string}): Context {
1313
return {
14+
excludeVsCodeConfig: false,
1415
config: {},
1516
exists: async (path: string) => path.toString() in files,
1617
read: async (path: string) => files[path.toString()],

components/server/src/config/config-inferrer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { WorkspaceConfig } from "@gitpod/gitpod-protocol";
88

99
export interface Context {
1010
config: WorkspaceConfig;
11+
excludeVsCodeConfig: boolean;
1112
exists(path: string): Promise<boolean>;
1213
read(path: string): Promise<string | undefined>;
1314
}
@@ -93,6 +94,9 @@ export class ConfigInferrer {
9394
}
9495

9596
protected addExtension(ctx: Context, extensionName: string) {
97+
if (ctx.excludeVsCodeConfig) {
98+
return;
99+
}
96100
if (!ctx.config.vscode || !ctx.config.vscode.extensions) {
97101
ctx.config.vscode = {
98102
extensions: []

components/server/src/config/configuration-service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export class ConfigurationService {
3838
this.requestedPaths.forEach(path => !(path in cache) && readFile(path));
3939
const configInferrer = new ConfigInferrer();
4040
const config: WorkspaceConfig = await configInferrer.getConfig({
41+
// TODO(se) pass down information about currently used IDE. Defaulting to disabling vscode extensions for now, to not bother non VS Code users.
42+
excludeVsCodeConfig: true,
4143
config: {},
4244
read: readFile,
4345
exists: async (path: string) => !!(await readFile(path)),

0 commit comments

Comments
 (0)