typst-lsp icon indicating copy to clipboard operation
typst-lsp copied to clipboard

[FR] Definition previewing and symbol renaming support

Open KagaJiankui opened this issue 2 years ago • 2 comments

  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] I have searched the discussions and believe that my question is not already covered.

Feature Request

The typst-lsp vscode extension doesn't provide hover previewing and symbol renaming, after the documentation symbols and outline is working fine.

image

Some features can be considered are listed below:

  • Jump to definition and jump to reference
  • Rename symbol document / workspace wide
  • Parameters hinting (like clangd/pylsp language server) when calling a function
    • Preview rendering by passing lorem() to the content typed parameters

The parameters hinting means something similar to the clangd or pylsp language server and it hints the parameters and types of a function defined by #let or a pre-defined content block. For further enhancement, doxygen or similiar documentation purposed comments can also be renderered like the existing language servers.

image

In the quick suggestions, the members/symbols corresponding to the types of the arguments might be placed at the higher priority. In the C++ language server examples below, the randomize_matrix() expects an struct, thus the struct m1 and m2 are preposed.

image

KagaJiankui avatar Aug 08 '23 13:08 KagaJiankui

I was about to open an issue (not as complete as this one tho)

Ciflire avatar Feb 14 '24 09:02 Ciflire

seems to be included in this issue but came here specifically to suggest F2 for reference renaming (of figures, equations, sections, ...)

janosh avatar Mar 04 '24 09:03 janosh