Skip to content

Commit 2c422fe

Browse files
authored
Fixes broken mapcode LSP flow from razor to c# (#10299)
Fixes #10040
1 parent 7ee5016 commit 2c422fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_MapCode.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ private void ConvertCSharpFocusLocationUris(Location[][] focusLocations)
8383

8484
private static bool SupportsMapCode(JToken token)
8585
{
86-
return token is JObject obj
87-
&& obj.TryGetValue(VSInternalMethods.WorkspaceMapCodeName, out var supportsMapCode)
88-
&& supportsMapCode.ToObject<bool>();
86+
var serverCapabilities = token.ToObject<VSInternalServerCapabilities>();
87+
88+
return serverCapabilities?.MapCodeProvider ?? false;
8989
}
9090
}

0 commit comments

Comments
 (0)