Skip to content

Commit 8558b71

Browse files
authored
Don't get capabilities before they're available (#10300)
Fixes a PRISM fault I can't find the link for right now
2 parents 89f1eaa + d067952 commit 8558b71

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WorkspaceSemanticTokensRefreshNotifier.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ public void NotifyWorkspaceSemanticTokensRefresh()
7373
return;
7474
}
7575

76+
// We could have been called before the LSP server has even been initialized
77+
if (!_clientCapabilitiesService.CanGetClientCapabilities)
78+
{
79+
return;
80+
}
81+
7682
_supportsRefresh ??= _clientCapabilitiesService.ClientCapabilities.Workspace?.SemanticTokens?.RefreshSupport ?? false;
7783

7884
if (_supportsRefresh is false)

0 commit comments

Comments
 (0)