Skip to content

Commit

Permalink
Specify return type for createHost (#9295)
Browse files Browse the repository at this point in the history
Currently the return type of PyrightServer.createHost is left blank, inferred by typescript to be FullAccessHost. Therefore anyone who inherits from PyrightServer must also return FullAccessHost.

We should specify the return type explicitly. That way someone can inherit from it and return NoAccessHost, say.
  • Loading branch information
ljw1004 authored Oct 23, 2024
1 parent c03e064 commit 45da329
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/pyright-internal/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export class PyrightServer extends LanguageServerBase {
return new BackgroundAnalysis(this.serverOptions.serviceProvider);
}

protected override createHost() {
protected override createHost(): Host {
return new FullAccessHost(this.serverOptions.serviceProvider);
}

Expand Down

0 comments on commit 45da329

Please sign in to comment.