wader / jq-lsp

jq language server
MIT License
65 stars 2 forks source link

change function_name/1 to function(x) #22

Open Freed-Wu opened 1 week ago

Freed-Wu commented 1 week ago

Screenshot from 2024-10-12 10-23-03

  1. How about change the label of path/1 to path(a) like:

Screenshot from 2024-10-12 10-27-28

  1. Can we have a function signature like clangd for path(?

Screenshot from 2024-10-12 10-25-47

  1. some variable like $JQ_BUILD_CONFIGURATION doesn't exist in gojq. Should they be added manually?
wader commented 1 week ago

Screenshot from 2024-10-12 10-23-03

  1. How about change the label of path/1 to path(a) like:

Screenshot from 2024-10-12 10-27-28

That should be possible and i'm a bit surprised i didn't already do it, wonder if there was some issue? ill have a look

  1. Can we have a function signature like clangd for path(?

Screenshot from 2024-10-12 10-25-47

Show signature and documentation? with jq-lsp and vscode this is already possible using "textDocument/hover" but maybe other editors want something else?

Screenshot 2024-10-13 at 00 01 39

or do i misunderstand the issue?

  1. some variable like $JQ_BUILD_CONFIGURATION doesn't exist in gojq. Should they be added manually?

Yeap i've just forgot to add them, they can be added to https://github.com/wader/jq-lsp/blob/master/lsp/builtin_env.jq, for the most part the file is generated using this mess https://github.com/wader/jq-lsp/blob/master/lsp/gen_builtin_env.jq and i wonder if there is some way to find all globals automatically? 🤔

Freed-Wu commented 1 week ago

Show signature and documentation

It should be signature help? https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_signatureHelp

wader commented 1 week ago

Show signature and documentation

It should be signature help? https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_signatureHelp

Thanks, yeap! i did a quick hack and can get vscode to send textDocument/signatureHelp on ( but there is some problems with how jq-lsp works atm, for example func() is not valid jq so parsing fails, need to do some pre-massaging of the source 🤔 also noticed that you keep getting signature help calls when moving the cursor amoung the args, not sure how that can supported, maybe simplest possible for now.