-
-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement textDocument/inlayHint #559
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_hints
inzls.json
or throughzls config
If 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_builtin
bool
true
inlay_hints_exclude_builtins
[][]const u8
[]
inlay_hints_exclude_single_argument
bool
true
Note that these options are located in
src/inlay_hints.zig
and are currently not part ofzls config
orzls.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-vscode
andtiehuis.zig