Skip to content

[Spring Data Queries] Show inline hint for query parameter #1333

Closed

Description

@BoykoAlex

All Spring Data Query whether it is JPQL/HQL or a native SQL query support parameters coming from java code. Typically @query annotates a method, then :1 or ?2 found in the query would stand for the first and second parameter of the Java method respectively. It's be useful to show the name of the Java method parameter as inline hint to indicate which parameter the number corresponds to

Activity

  1. added this to the 4.26.0.RELEASE milestone on Aug 23, 2024
  2. BoykoAlex commented on Aug 28, 2024

    @BoykoAlex
    ContributorAuthor

    Fixed with 0063608 but doesn't seems that it is only useful for parameter ordinal

  3. martinlippert commented on Aug 28, 2024

    @martinlippert
    Member

    I've seen this working, but the end result doesn't look great to me. The code part :1% ends up looking like :1 lastname%. It seems to me like the inlay hint should be shown behind the % probably, with a little spacing behind the code lens in addition to the little space before the code lens.

  4. BoykoAlex commented on Aug 28, 2024

    @BoykoAlex
    ContributorAuthor

    Hmm... there is already space dedicated left of the inlay... Don't think LSP4E respects it properly...Perhaps we may need to remove the inlays - I didn't like them either to be honest.

  5. martinlippert commented on Aug 28, 2024

    @martinlippert
    Member

    I tried VSCode only for the moment, the space between :1 and lastname looks good to me, but I would move the hint entirely behind the % character, with spacing before and after.

  6. BoykoAlex commented on Aug 28, 2024

    @BoykoAlex
    ContributorAuthor

    The PR for LSP4E inlay hint padding issue: eclipse-lsp4e/lsp4e#1089
    Corrections to positioning of inlay hint on our side: fb072bf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: vscodetheme: spring-data-supporttype: enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions