Skip to content

Commit

Permalink
don't report "Unhandled method workspace/configuration" error as a no…
Browse files Browse the repository at this point in the history
…tification, workaround for #573
  • Loading branch information
DetachHead committed Aug 14, 2024
1 parent 4a62f24 commit 504abf4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/pyright-internal/src/realLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 504abf4

Please sign in to comment.