racket-langserver icon indicating copy to clipboard operation
racket-langserver copied to clipboard

fix textDocument/documentSymbol

Open JJPro opened this issue 5 years ago • 3 comments

I made symbol lookup/document outline working. Previously it would list all words in the document and the server would crash for big documents, Now it only looks for function definitions (define) and type definitions (define-type)

(also resolves #12 )

JJPro avatar Apr 10 '20 01:04 JJPro

I don't think this is a good change, because it is brittle in the face of macros that perform binding. The existing approach is to give all symbols and allow the lsp to basically be like emacs' M-/ where it just helps you complete symbols that already there. A more robust change would be to do what DrRacket does and look at the expansion for binding positions.

jeapostrophe avatar Apr 10 '20 14:04 jeapostrophe

Do we have any way to find out which expressions are binding, without resorting to some sort of string pattern match?

Eugleo avatar Apr 29 '20 12:04 Eugleo

DrRacket has a library implement for this, as part of Check Syntax, that fully-expands the program and then inspects the source code for binding information in the syntax objects.

jeapostrophe avatar Apr 29 '20 14:04 jeapostrophe