jeapostrophe / racket-langserver

Other
263 stars 24 forks source link

`get-bindings` returns `#f` -> language server crashes #50

Closed 9999years closed 3 years ago

9999years commented 3 years ago

Here's the log. I think the append call in question is on text-document.rkt:294:

                (or (append (get-bindings uri decl) (list (start/end->Range doc-text left right))))))

Log:

[Error - 5:26:52 PM] Request textDocument/documentHighlight failed.
  Message: internal error in method "textDocument/documentHighlight"
  Code: -32603 
Caught exn in request "textDocument/documentHighlight"
append: contract violation
  expected: list?
  given: #f
  context...:
   C:\Users\berry\AppData\Roaming\Racket\8.0\pkgs\racket-langserver\text-document.rkt:281:0: document-highlight
   C:\Program Files\Racket\collects\racket\contract\private\arrow-val-first.rkt:486:18
   C:\Users\berry\AppData\Roaming\Racket\8.0\pkgs\racket-langserver\methods.rkt:26:0: process-message
   C:\Program Files\Racket\collects\racket\contract\private\arrow-val-first.rkt:486:18
   C:\Users\berry\AppData\Roaming\Racket\8.0\pkgs\racket-langserver\main.rkt:53:2: consume

Version:

> racket --version
Welcome to Racket v8.0 [cs].
jeapostrophe commented 3 years ago

Thanks for the catch. https://github.com/jeapostrophe/racket-langserver/blob/master/text-document.rkt#L355 needs to be empty instead. I'll push a fix.