jeapostrophe / racket-langserver

Other
262 stars 24 forks source link

Report version mismatch errors found during background expansion #115

Closed shhyou closed 1 year ago

shhyou commented 1 year ago

When there is a .zo version mismatch error in an imported module (presumably caused by upgrading Racket), the language server does not report anything because the source locations (prop:exn:srclocs) in the raised exception is empty.

This PR specifically looks for errors that look like version mismatches and reports the error message from the exception. For example, consider this piece of code.

#lang racket/base
(require lib)
; (require "local-lib.rkt")
(printf "hello = ~a\n" hello)

Assume that the .zo files of lib is out-of-date. This PR reports the following error message and the suggestions to run raco setup:

ver-mismatch-from-lib

If, to the contrary, "local-lib.rkt" rather than lib is out-of-date, this PR produces a different suggestion:

ver-mismatch-from-usr