Skip to content

Commit 9bf916f

Browse files
author
Andrew Hall
committed
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 05beba2 commit 9bf916f

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
@@ -222,7 +222,7 @@ export class RazorLanguageServerClient implements vscode.Disposable {
222222
}
223223

224224
public async connectNamedPipe(pipeName: string): Promise<void> {
225-
await this.startHandle;
225+
await this.start();
226226

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

0 commit comments

Comments
 (0)