Repository navigation
Conversation
…tants only Like TypeScript's includeInlayParameterNameHints: "all" (the default), "literals" for constant arguments only, or "none".
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.
Stacked on #931.
Inlay hints could only be on or off. On calls whose arguments are column references or expressions, the parameter names mostly repeat what the code already says; on constants they're the useful part.
{ "inlayHints": { "parameterNames": "literals" } }I kept it to the three values TypeScript has (
includeInlayParameterNameHints: "none" | "literals" | "all"). rust-analyzer only has an on/off switch, and an argument named like its parameter already gets no hint here, like TypeScript's...WhenArgumentMatchesNamedefault.What changed
inlayHints.parameterNames(all,literals,none) in the configuration, with schema, TS types and the editor features docs regenerated or updated.pgls_inlay_hints::ParameterNameHints, passed toinlay_hints_of_referencesandInlayHintsParams. A literal is one token that is a string, number, bit string, boolean orNULL, or a sign and a number. Casts like'1'::intand typed literals likedate '...'don't count.pull_inlay_hintsreturns nothing fornone, like forenabled: false.Tests
Configuration deserialization (and rejecting unknown values), the crate's hints with
literals, and a workspace test for all three values.