diff --git a/packages/pyright-internal/src/realLanguageServer.ts b/packages/pyright-internal/src/realLanguageServer.ts index 3772f9ba69..3b1298c689 100644 --- a/packages/pyright-internal/src/realLanguageServer.ts +++ b/packages/pyright-internal/src/realLanguageServer.ts @@ -213,10 +213,16 @@ export abstract class RealLanguageServer extends LanguageServerBase { } } } catch (error) { - this.connection.sendNotification(ShowMessageNotification.type, { - message: error instanceof Error ? error.message : error, - type: MessageType.Error, - }); + const errorMessage = error instanceof Error ? error.message : error; + // workaround for https://github.com/DetachHead/basedpyright/issues/573 + if (errorMessage === 'Unhandled method workspace/configuration') { + this.console.error(`Error reading settings: ${error}`); + } else { + this.connection.sendNotification(ShowMessageNotification.type, { + message: errorMessage, + type: MessageType.Error, + }); + } } return serverSettings; }