Skip to content

Commit c78ef06

Browse files
authored
Notify Pylance on jupyter.runStartupCommands config change (#20237)
1 parent ad46fb3 commit c78ef06

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/client/activation/common/analysisOptions.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export abstract class LanguageServerAnalysisOptionsBase implements ILanguageServ
4242
documentSelector,
4343
workspaceFolder,
4444
synchronize: {
45-
configurationSection: PYTHON_LANGUAGE,
45+
configurationSection: this.getConfigSectionsToSynchronize(),
4646
},
4747
outputChannel: this.output,
4848
revealOutputChannelOn: RevealOutputChannelOn.Never,
@@ -58,6 +58,10 @@ export abstract class LanguageServerAnalysisOptionsBase implements ILanguageServ
5858
return this.workspace.isVirtualWorkspace ? [{ language: PYTHON_LANGUAGE }] : PYTHON;
5959
}
6060

61+
protected getConfigSectionsToSynchronize(): string[] {
62+
return [PYTHON_LANGUAGE];
63+
}
64+
6165
protected async getInitializationOptions(): Promise<any> {
6266
return undefined;
6367
}

src/client/activation/node/analysisOptions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export class NodeLanguageServerAnalysisOptions extends LanguageServerAnalysisOpt
2626
super(lsOutputChannel, workspace);
2727
}
2828

29+
protected getConfigSectionsToSynchronize(): string[] {
30+
return [...super.getConfigSectionsToSynchronize(), 'jupyter.runStartupCommands'];
31+
}
32+
2933
// eslint-disable-next-line class-methods-use-this
3034
protected async getInitializationOptions(): Promise<LanguageClientOptions> {
3135
return ({

src/client/browser/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ async function runPylance(
7777
],
7878
synchronize: {
7979
// Synchronize the setting section to the server.
80-
configurationSection: ['python'],
80+
configurationSection: ['python', 'jupyter.runStartupCommands'],
8181
},
8282
middleware,
8383
};

0 commit comments

Comments
 (0)