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

Server initialization failed: The JSON sent is not a valid request object. (racket/racket#4532) #94

Closed
shhyou opened this issue Feb 2, 2023 · 1 comment

Comments

@shhyou
Copy link
Contributor

shhyou commented Feb 2, 2023

A recent bug fix racket/racket#4532 going into Racket 8.8 changes the semantics of hash table patterns, so it breaks racket-langserver with the following error messages:

A request has failed. See the output for more information.

Server initialization failed.
  Message: The JSON sent is not a valid request object.
  Code: -32600 

Starting client failed
  Message: The JSON sent is not a valid request object.
  Code: -32600 

This piece of code now expects to match the full hash table instead of matching only the mentioned key-value pair:

;; Before: check the `id` field and the `method` field
;; After: asserts that `msg` only has the `id` field and the `match` field
(match msg
    ;; Request
    [(hash-table ['id (? (or/c number? string?) id)]
                 ['method (? string? method)])
     (define params (hash-ref msg 'params hasheq))
     (define response (process-request id method params))
     (display-message/flush response)]
    ...

I'm happy to send a PR but it'd take a while.

@shhyou
Copy link
Contributor Author

shhyou commented Jul 21, 2023

Closing as racket/racket#4532 is reverted. sorawee's new PR racket/racket#4632 uses a different pattern name.

@shhyou shhyou closed this as completed Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant