Skip to content

PrepareRead serialisation failed #372

@hendrikmennen

Description

@hendrikmennen

I want to implement renaming using the client.

30-Sep-2020 13:40:45.855> [ERROR]: Unable to find a constructor to use for type OmniSharp.Extensions.LanguageServer.Protocol.Models.RangeOrPlaceholderRange. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'result.end', line 1, position 40.
Newtonsoft.Json.JsonSerializationException: Unable to find a constructor to use for type OmniSharp.Extensions.LanguageServer.Protocol.Models.RangeOrPlaceholderRange. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'result.end', line 1, position 40.
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, String id, Boolean& createdFromNonDefaultCreator)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, 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 VHDPlus.LanguageService.LanguageService.PrepareRename

This is what got sent by my language server:

[00:00:09] C++ LS: V[13:54:48.493] <<< {"id":3,"jsonrpc":"2.0","method":"textDocument/prepareRename","params":{"position":{"character":5,"line":13},"textDocument":{"uri":"file:///c:/Users/HendrikMennen/Documents/VHDPlus/Projects/vhdplus-tests/NIOSTest/Software/NIOSDuino/NIOSDuino.cpp"}}}
[00:00:09] C++ LS:
[00:00:09] C++ LS: I[13:54:48.493] <-- textDocument/prepareRename(3)
[00:00:09] C++ LS: I[13:54:48.493] --> reply:textDocument/prepareRename(3) 0 ms
[00:00:09] C++ LS: V[13:54:48.493] >>> {"id":3,"jsonrpc":"2.0","result":{"end":{"character":7,"line":13},"start":{"character":4,"line":13}}}

Any idea what could be wrong here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions