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;