jeapostrophe / racket-langserver

Other
262 stars 24 forks source link

fix `textDocument/definition` method #113

Closed 6cdh closed 1 year ago

6cdh commented 1 year ago

I fixed a bug that introduced in previous PR, which caused textDocument/definition method cannot return the correct place for the symbol whose definition is in another file.

It basically change the code in get-definition

(start/end->range this-doc start end)

to

(start/end->range doc-text start end)

The a lot of changes happen because doc-text is a lsp-editor% object, not a Doc struct, it can't use Doc method.

I also want to push to gradually use internal structs which use contract to make sure they are compatible with lsp specification types. These structs can also convert from/to jsexpr when necessary. This would avoid the need to build jsexpr everywhere.