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

parameter help not shown when command was completed

Open Marmare314 opened this issue 2 years ago • 6 comments

When removing the parenthesis and adding them again it works as expected.

Marmare314 avatar Mar 27 '23 05:03 Marmare314

I confirm this. To be clear: when one starts to write a command, e.g. #tabl and then hits tab to autocomplete the suggestion (#table), the autocompleted code looks like #table() with the cursor between the parentheses, but no tooltip is shown for the arguments.

beeb avatar Mar 29 '23 19:03 beeb

Maybe @jakobhellermann has an idea here?

beeb avatar Mar 29 '23 19:03 beeb

See https://github.com/microsoft/language-server-protocol/issues/274

I tried to add the editor.action.triggerParameterHints command for all CompletionItems but it doesn't work for me, and would also be only a solution for clients that implement this command.

beeb avatar Mar 31 '23 06:03 beeb

Parameter hints were my only other idea I wanted to try out, I'm not sure if there is another better way

jakobhellermann avatar Mar 31 '23 06:03 jakobhellermann

https://github.com/beeb/typst-lsp/blob/completion-to-param-hint/src/main.rs#L438-L442

Feel free to try it out, but doesn't work for me.

beeb avatar Mar 31 '23 06:03 beeb

I just noticed that this does not work in other language servers either (for example clangd). What clangd does instead is just auto complete the required parameters. They can then be changed and switched between by pressing tab.

image

Marmare314 avatar Oct 03 '23 07:10 Marmare314