Implement textDocument/inlayHint#559
Implement textDocument/inlayHint#559SuperAuguste merged 4 commits intozigtools:masterfrom Techatrix:master
Conversation
|
Ok so this is absolutely awesome!! Heading to bed now but I'll look at this ASAP tomorrow! Thank you so much! |
|
I'll take care of the |
|
Gotta figure out what's up with the CI, I'll try to unbrick it really quickly and then merge this! |
|
Aren't the config options meant for the end user? |
I couldn't quite figure out what it was doing so I added it to the config anyways, thanks for letting me know that this isn't meant to be configurable for end-users! I'll fix it up once I get tests passing. |
|
I couldn't salvage tests, I'll finalize the config and then work on fixing them in a separate PR; sorry for the trouble! |
|
@Techatrix Thank you so much for this! :-) Do you have plans for adding inlay hints for local const/var variables? |
|
I didn't implement them because right now they wouldn't work in many cases. You can check that by hovering over many symbols, if you see 'unknown' as the type then inlay hints wouldn't show a type as well. Once type resolution is improved we can work on inlay hints for types. |
The LSP Specification introduced inlay hints in version 3.17 Reference
This PR adds supports for parameter inlay hints for function calls including builtins.
This feature is disabled by default and must be enabled by settings
enable_inlay_hintsinzls.jsonor throughzls configIf a function call can display hover information but can't show inlay hints its probably a bug, feel free to inform me.
Options
The following options are currently implemented:
inlay_hints_show_builtinbooltrueinlay_hints_exclude_builtins[][]const u8[]inlay_hints_exclude_single_argumentbooltrueNote that these options are located in
src/inlay_hints.zigand are currently not part ofzls configorzls.json.I am open to suggestions for more options and better defaults.
Examples taken from VS Code
Hovering over a hint will show its type
Tested on
augusterame.zls-vscodeandtiehuis.zig