[fpc-pascal] JSON RPC on Mac M1 fails
Michael Van Canneyt
michael at freepascal.org
Thu Mar 10 08:55:30 CET 2022
On Thu, 10 Mar 2022, Hairy Pixels via fpc-pascal wrote:
>
>> On Mar 9, 2022, at 10:48 PM, Michael Van Canneyt via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
>>
>>> It breaks early on when sending the first message (initialize) which I register like this:
>>>
>>> JSONRPCHandlerManager.RegisterHandler('initialize', TInitialize);
>>
>> So you get an exception here ?
>
> No that’s fine it’s when the client (Sublime Text) returns with the error below.
>
>>
>>>
>>> And then the client returns back the message:
>>>
>>> No class "initialize" with method "initialize" was found.
>>
>> It's not normal that there is 2 times 'initialize' ?
>
> So the class should be TInitialize right? That’s the class I registered so it makes sense it couldn’t find it if it thinks it’s called “initialize”.
No, initialize is correct for the class name, you registered the handler
with that name. I don't know what the method name is.
>
>
>> I fixed some bugs in the JSONRPC mechanism.
>> Maybe you are now bumping into something that used to work by accident but
>> which is now caught…
>
>
> I’m building from 3.2.2 sources and I rebuilt for x86 (which runs on the M1 also) and the bug goes away so there’s something about this particular architecture.
Barring an uninitialized variable, this seems to rule out an error in
JSON-RPC itself. There is nothing architecture-specific about the code.
>
> Are there any tests I could run to try to figure this out? I’m not very familiar with the JSON RPC library except that I extended an already existing implementation.
The only way is to debug your server, see where it goes wrong.
Michael.
More information about the fpc-pascal
mailing list