Now with Golang and Python support!
This extension implements the new Inlay Hints API to add Inline Parameters for Golang, Java, Lua, PHP, and Python.
This is a feature that was popularized by JetBrains' IDEs that can give you additional context when reading your code, making it easier to understand what different function parameters refer to by showing the parameter's name inline.
Speed up your development with parameter hints!
Currently, this extension supports the following languages:
- Golang
- Java
- Lua (with Sumneko's Lua language server)
- PHP (with the Intelephense language server)
- Python
This extension utilizes the Inlay-Hints API provided by VSCode. Here are some additional settings provided by VSCode.
Name | Description | Default |
---|---|---|
editor.inlayHints.enabled |
Enables Inlay Hints for the editor. | true |
editor.inlayHints.fontFamily |
Controls font family of inlay hints in the editor. When set to empty, the #editor.fontFamily# is used. |
"" |
editor.inlayHints.fontSize |
Controls font size of inlay hints in the editor. A default of 90% of #editor.fontSize# is used when the configured value is less than 5 or greater than the editor font size. |
0 |
There are also several settings to enable Inlay Hints for both JavaScript and TypeScript. These settings are available in the following setting sections.
javascript.inlayHints
typescript.inlayHints
Additional language support is welcome as pull requests, and highly encouraged. You can see the source code to see how existing languages have been implemented.
Currently, the extension has 2 major steps that all language drivers must implement:
- Parsing the source code of the currently active file (Using an AST library - AST Explorer can assist in navigating it) to retrieve a list of positions where annotations should be inserted.
- Getting the name of the parameters to use as the annotations. Existing language drivers do this by triggering the hover providers for the function being called, and extracting the parameter names from the description.
- Benjamin Lannon for the (no longer maintained) VSCode JS Annotations extension (where some AST parsing for the Javascript languages was borrowed from)
- Bobby Zrncev for the IntelliJ Parameter Hints extension which achieves the same for PHP
- jrieken
- Liam Hammett
- RichardLuo0
- VSCode's Extension Samples, which was a huge help to get started
- All Contributors
The MIT License (MIT). Please see the license file for more information.