From c16c73f5fea5f9e283e33307137118270dbff77c Mon Sep 17 00:00:00 2001 From: detachhead Date: Tue, 30 Jun 2026 21:34:28 +1000 Subject: [PATCH] fix redundant `workspace/configuration` request --- packages/pyright-internal/src/realLanguageServer.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/pyright-internal/src/realLanguageServer.ts b/packages/pyright-internal/src/realLanguageServer.ts index a477dc0a2..00f95be07 100644 --- a/packages/pyright-internal/src/realLanguageServer.ts +++ b/packages/pyright-internal/src/realLanguageServer.ts @@ -151,10 +151,9 @@ export abstract class RealLanguageServer extends LanguageServerBase { } } - const pythonAnalysisSection = - (await this.getConfiguration(workspace.rootUri, 'basedpyright.analysis')) || - // this is undocumented, but we support the old section names for backwards compatibility with the pycharm pyright plugin - pythonSection?.analysis; + const basedpyrightSection = await this.getConfiguration(workspace.rootUri, 'basedpyright'); + // this is undocumented, but we support the old section names for backwards compatibility with the pycharm pyright plugin + const pythonAnalysisSection = basedpyrightSection?.analysis || pythonSection?.analysis; if (pythonAnalysisSection) { const typeshedPaths = pythonAnalysisSection.typeshedPaths; if (typeshedPaths && Array.isArray(typeshedPaths) && typeshedPaths.length > 0) { @@ -258,10 +257,8 @@ export abstract class RealLanguageServer extends LanguageServerBase { serverSettings.autoSearchPaths = true; } - const pyrightSection = - (await this.getConfiguration(workspace.rootUri, 'basedpyright')) || - // this is undocumented, but we support the old section names for backwards compatibility with the pycharm pyright plugin - (await this.getConfiguration(workspace.rootUri, 'pyright')); + // this is undocumented, but we support the old section names for backwards compatibility with the pycharm pyright plugin + const pyrightSection = basedpyrightSection || (await this.getConfiguration(workspace.rootUri, 'pyright')); if (pyrightSection) { if (pyrightSection.openFilesOnly !== undefined) { serverSettings.openFilesOnly = !!pyrightSection.openFilesOnly;