Skip to content

Commit 7b37ae4

Browse files
committed
Merged PR 473808: Use arrow function to explicitly capture this
Otherwise when green calls our function back, 'this' does not point to the language server any more (it is undefined). See https://stackoverflow.com/questions/20279484/how-to-access-the-correct-this-inside-a-callback Related work items: #1823584
2 parents 9512114 + 2433312 commit 7b37ae4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lsptoolshost/roslynLanguageServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ export class RoslynLanguageServer {
329329
this._languageClient?.sendNotification("serviceBroker/connect", { pipeName: pipeName });
330330
} else {
331331
// We'll subscribe if the process later launches, and call this function again to send the pipe name.
332-
this.context.subscriptions.push(exports.serverProcessLoaded(this.sendOrSubscribeForServiceBrokerConnection));
332+
this.context.subscriptions.push(exports.serverProcessLoaded(async() => this.sendOrSubscribeForServiceBrokerConnection()));
333333
}
334334
}
335335
}

0 commit comments

Comments
 (0)