[fpc-pascal] Pascal Language Server

Michael Van Canneyt michael at freepascal.org
Fri Apr 24 07:46:54 CEST 2020



On Fri, 24 Apr 2020, Ryan Joseph via fpc-pascal wrote:

>
>
>> On Apr 24, 2020, at 10:23 AM, Ryan Joseph <genericptr at gmail.com> wrote:
>> 
>> Just tested on my language server and the problem is you provided a null error key, which is not in the protocol.
>> 
>> I've never seen the fpjsonrpc unit before so I don't know where this got inserted but it needs to be removed.
>
> I think we need to override a method to remove the null error, like this:
>
> function TLSPDispatcher.FormatResult(Const AClassName, AMethodName: TJSONStringType;
> Const Params,ID, Return : TJSONData) : TJSONData;
>
> begin
>  Result:=TJSONObject.Create([
>    'result',Return,
>    TransactionProperty,ID.Clone
>    ]);
>  if jdoJSONRPC2 in options then
>    TJSONObject(Result).Add('jsonrpc','2.0');
> end;

I fixed TCustomJSONRPCDispatcher not to add a Null in case of V2. But V1 needs it.
see https://www.jsonrpc.org/specification_v1

Committed in revision 45047.

Michael.


More information about the fpc-pascal mailing list