Skip to content

Commit 2865240

Browse files
author
Andrew Hall
committed
Don't try to send dynamicInfoChanged if the server isn't running
1 parent 69234b0 commit 2865240

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/lsptoolshost/roslynLanguageServer.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,13 @@ export class RoslynLanguageServer {
793793
vscode.commands.registerCommand(
794794
DynamicFileInfoHandler.dynamicFileUpdatedCommand,
795795
async (notification: RazorDynamicFileChangedParams) =>
796-
this.sendNotification<RazorDynamicFileChangedParams>('razor/dynamicFileInfoChanged', notification)
796+
{
797+
if (this.isRunning()) {
798+
this.sendNotification<RazorDynamicFileChangedParams>('razor/dynamicFileInfoChanged', notification)
799+
} else {
800+
_channel.debug('Tried to send razor/dynamicFileInfoChanged while server is not running');
801+
}
802+
}
797803
);
798804
}
799805

0 commit comments

Comments
 (0)