Skip to content

Commit

Permalink
fix "Unhandled method" errors caused by lsp requests being sent too e…
Browse files Browse the repository at this point in the history
…arly or something
  • Loading branch information
DetachHead committed Sep 1, 2024
1 parent eec3a16 commit dc56696
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 0 additions & 2 deletions packages/pyright-internal/src/languageServerBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,6 @@ export abstract class LanguageServerBase implements LanguageServerInterface, Dis

// Create a service instance for each of the workspace folders.
this.workspaceFactory.handleInitialize(params);
// Bug? Or do we need to send another event always?
this.updateSettingsForAllWorkspaces();

if (this.client.hasWatchFileCapability) {
this.addDynamicFeature(
Expand Down
13 changes: 4 additions & 9 deletions packages/pyright-internal/src/realLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,10 @@ export abstract class RealLanguageServer extends LanguageServerBase {
}
} catch (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,
});
}
this.connection.sendNotification(ShowMessageNotification.type, {
message: errorMessage,
type: MessageType.Error,
});
}
return serverSettings;
}
Expand Down

0 comments on commit dc56696

Please sign in to comment.