Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid response to the workspace/SemanticTokens/refresh notification #11387

Open
AmadeusW opened this issue Jan 13, 2025 · 1 comment
Open

Comments

@AmadeusW
Copy link
Contributor

AmadeusW commented Jan 13, 2025

When debugging VS I was innoudated with JsonRpc warnings that No target methods are registered that match "NotificationRequested" (see azdo 2341995)
When monitoring traffic between the LSP Client and Server I noticed that the response to workspace/SemanticTokens/refresh notification has invalid json; I think for this to work correctly (and not produce warnings), the response should be "method": "workspace/SemanticTokens/refresh". Currently, it is "method": "NotificationReceived" with "params.MethodName": "workspace/SemanticTokens/refresh"

@davidwengier
Copy link
Contributor

davidwengier commented Jan 14, 2025

@AmadeusW what made you decide this is Razor? I can't see where this is us. We send that notification here:
https://github.com/dotnet/razor/blob/main/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WorkspaceSemanticTokensRefreshNotifier.cs#L49

Which is just a straight call to JsonRPC's NotifyAsync method:
https://github.com/dotnet/razor/blob/main/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ClientConnection.cs#L45

Indeed the string "NotificationReceived" doesn't appear in our repo anywhere. I'm also seeing these same messages logged for the Roslyn server too:
Image

Are you sure this is coming from us? I could see this happening if something is sending this message to us, as we don't support that method, so the log message makes sense. We send it to the client, but perhaps there is something out there that is blasting that message to all clients? The method that I'm debugging in that screenshot is "DispatchIncomingRequest"

I couldn't see a way to identify any of that in the debugger though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants