Repository navigation
Conversation
psteinroe
force-pushed
the
feat/inlay-hints
branch
from
October 18, 2026 07:42
2a59681 to
81092fc
Compare
psteinroe
added this pull request to stack #869
October 18, 2026 08:04
psteinroe
removed this pull request from stack #869
October 18, 2026 15:19
psteinroe
force-pushed
the
feat/inlay-hints
branch
from
October 18, 2026 18:19
d33500b to
bd1847d
Compare
This was referenced Oct 19, 2026
psteinroe
force-pushed
the
feat/inlay-hints
branch
from
October 19, 2026 12:47
bd1847d to
621ee49
Compare
Show the names of the parameters that positional function arguments are passed to. The catalog resolver records the calls that overload resolution selects exactly one function for, now also for explicit VARIADIC calls, and the new pgls_inlay_hints crate turns them into hints. The workspace exposes pull_inlay_hints, following the file's DDL like the analyser, and the language server advertises inlayHintProvider. Closes #130
Generalise the function call recording of the resolver into opt-in references on Resolution: function calls, columns and relations that resolve to exactly one object. Replaces resolve::function_calls; inlay hints read the function references instead.
Hover resolves the statement at the cursor with the catalog the analyser sees and shows the function overload, column, or relation the hovered name resolves to. CTE and subquery columns show their inferred type. Without a unique reference, hover falls back to the name lookups. Hover now uses the innermost statement, so it also works inside SQL function bodies.
Walk the statements like the analyser does since migration sections: each section gets a session of its own, and a down section sees the catalog after the up sections before it without carrying its own changes into the next section.
psteinroe
force-pushed
the
feat/inlay-hints
branch
from
October 19, 2026 13:07
621ee49 to
d85bcb2
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bring back parameter-name inlay hints, and make hover show what a name actually resolves to. Both are built on a new opt-in API on the catalog resolver that returns resolved references, not just errors.
Resolved references (
pgls_catalog)resolvecan now also return what the names of a statement resolve to. This is enabled withResolveParams::collect_referencesand returned inResolution::references:Function { function, arguments }: the overload a call resolves to viaselect_function, and which parameter each argument goes to.Column { source, column }:sourceis a catalog relation, a CTE or a subquery alias. The column is recorded under its source's own name, even when an alias renames it. CTE and subquery columns carry their inferred type.Relation { relation }: catalog relations in FROM and the targets of INSERT, UPDATE, DELETE and COPY.Each reference has a location and span. A reference is only recorded when a name resolves to exactly one object. The linter passes
false, so nothing is collected or allocated on its path, and a test checks that findings are identical either way. ExplicitVARIADICcalls now go through overload resolution too, but are never reported. The Postgres regression suite passes, so typecheck findings are unchanged.Inlay hints
A
name:hint before positional function arguments when the call resolves to exactly one function:No hints for named arguments, unnamed parameters, arguments already named like the parameter, ambiguous or unknown calls, or SQL-syntax calls like
EXTRACT. Adds the newpgls_inlay_hintscrate,pull_inlay_hintsin the workspace, andinlayHintProviderwith atextDocument/inlayHinthandler in the language server.Hover
Hover resolves the innermost statement at the cursor with the file's DDL applied:
It falls back to today's name-based lookup when there is no unique reference. Hover now also works inside SQL function bodies. All existing hover snapshots are unchanged.
Risks and gaps
walk_statementshelper. It's fine for typical files, but adds cost on very long ones.walk_statementsfollows dbmate/goose migration sections like the analyser does. Each section gets its own session, and a down section sees the catalog after the up sections before it, without carrying its own DDL into the next section. Hover and inlay hints still work in down sections skipped withlintDown: false, because those sections are only excluded from linting.UPDATE SETtargets,excluded/old/new, NATURAL joins, or columns of functions in FROM. Hovering a table alias (uinu.name) still uses the name lookup.CALL proc(...)gets no inlay hints, because the resolver doesn't handleCallStmt.Fixes #130