Include location and documentation for Inlay Hints #1309
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement InlayHintLabelPart support per LSP 3.17 spec to enable clickable type names in inlay hints that navigate to type definitions.
InlayHint.label is now a vector of inlay hint label parts. Given the type string decomposition, we construct a part for each known type. These types include location data, to support go-to-definition. For extern types, we include the documentation as part the tooltip. We do not bother adding tooltip for other types, because the language client will automatically find documentation for the given location by sending a Hover request. This closes #877.
For regular parts, we construct a string part as usual.
Works for named types (extern, named table types), as well as composites (generics, unions, intersections)
Closes #876
Requires upstream support in Luau for type string decompositions: luau-lang/luau#2163