OmniSharp / OmniSharp/csharp-language-server-protocol
NotImplementedException when trying to get document diagnostics
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 638
- Forks
- 109
- Avg merge
- 1m
- Merged PRs (30d)
- 2
Description
I have the following code where I try to get document diagnostics from the language server and it always gives me a NotImplemented exception when I try to get it.
var report = await client.RequestDocumentDiagnostic(new DocumentDiagnosticParams()
{
TextDocument = textDocument,
Identifier = "luau"
});
Console.WriteLine(report);
error:
Unhandled exception. System.NotImplementedException: The method or operation is not implemented.
at OmniSharp.Extensions.LanguageServer.Protocol.Models.RelatedDocumentDiagnosticReport.Converter.ReadJson(JsonReader reader, Type objectType, RelatedDocumentDiagnosticReport existingValue, Boolean hasExistingValue, JsonSerializer serializer)
at Newtonsoft.Json.JsonConverter`1.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
at Newtonsoft.Json.Linq.JToken.ToObject[T](JsonSerializer jsonSerializer)
at OmniSharp.Extensions.JsonRpc.ResponseRouter.ResponseRouterReturnsImpl.Returning[TResponse](CancellationToken cancellationToken)
at OmniSharp.Extensions.LanguageServer.Protocol.Progress.ProgressManager.<>c__DisplayClass26_0`1.<<MakeRequest>b__0>d.MoveNext()
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at RelatedDocumentDiagnosticReport.Converter.ReadJson, the entry point named in the stack trace, and reproduce the RequestDocumentDiagnostic call shown in the issue. Inspect the diagnostic response handling and compare the received report shape with the expected model; done means document diagnostics deserialize without NotImplementedException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100