Skip to content

Commit ed7d45f

Browse files
committed
Fix didOpen getting stuck due to undefined this
1 parent 68654f0 commit ed7d45f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/session.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,21 +490,21 @@ export class SessionManager implements Middleware {
490490
// is fully initialized. This prevents stale parser diagnostics (e.g.
491491
// unresolved custom attribute types) that would otherwise appear because
492492
// textDocument/didOpen is sent before the server's type resolution is ready.
493-
public async didOpen(
493+
public didOpen = async (
494494
document: vscode.TextDocument,
495495
next: (document: vscode.TextDocument) => Promise<void>,
496-
): Promise<void> {
496+
): Promise<void> => {
497497
await this.started.promise;
498498
return next(document);
499-
}
499+
};
500500

501-
public async didChange(
501+
public didChange = async (
502502
event: vscode.TextDocumentChangeEvent,
503503
next: (event: vscode.TextDocumentChangeEvent) => Promise<void>,
504-
): Promise<void> {
504+
): Promise<void> => {
505505
await this.started.promise;
506506
return next(event);
507-
}
507+
};
508508

509509
// TODO: Is this used by the magic of "Middleware" in the client library?
510510
public resolveCodeLens(

0 commit comments

Comments
 (0)