Skip to content

Commit 7b6600a

Browse files
author
Andrew Hall
authored
Make sure named pipe awaits server start (#7645)
In cases where the workspace does not contain a razor or cshtml file startup is delayed for razor. This helps make sure we don't initialize when not needed. That also means that if a user opens a solution that contains a reference to a project outside of the workspace then startup will be delayed. This is generally fine because it will be initialized when needed, but there was an issue where the named pipe setup was trying to wait the startup task that had not been created yet. An await on undefined immediately returns and the project system will never get information about the project through the named pipe.
1 parent ec1d55d commit 7b6600a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/razor/src/razorLanguageServerClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export class RazorLanguageServerClient implements vscode.Disposable {
223223
}
224224

225225
public async connectNamedPipe(pipeName: string): Promise<void> {
226-
await this.startHandle;
226+
await this.start();
227227

228228
// Params must match https://github.com/dotnet/razor/blob/92005deac54f3e9d1a4d1d8f04389379cccfa354/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/RazorNamedPipeConnectParams.cs#L9
229229
await this.sendNotification('razor/namedPipeConnect', { pipeName: pipeName });

0 commit comments

Comments
 (0)