Skip to content

Conversation

@JohnnyMorganz
Copy link
Owner

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)

image

Closes #876

Requires upstream support in Luau for type string decompositions: luau-lang/luau#2163

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 17, 2026

Deploying luau-lsp with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5dab0e1
Status: ✅  Deploy successful!
Preview URL: https://e872b87d.luau-lsp.pages.dev
Branch Preview URL: https://inlay-hint-locations.luau-lsp.pages.dev

View logs

@JohnnyMorganz JohnnyMorganz enabled auto-merge (squash) January 17, 2026 11:24
@JohnnyMorganz JohnnyMorganz merged commit ac76368 into main Jan 17, 2026
14 checks passed
@JohnnyMorganz JohnnyMorganz deleted the inlay-hint-locations branch January 17, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide documentation on inlay hints Support go to definition on inlay hints

2 participants