Skip to content

Libdoc: Type information not shown correctly with embedded arguments #5598

Open

Description

@pekkaklarck

This manifests differently with library keywords and user keywords.

With library keywords typing is added to arguments of the implementing Python function:

@keyword("Hello, ${name}!"):
def hello(name: str):
    print(name)

In this case Libdoc doesn't show the name argument separately at all, the only thing it shows is the keyword name Hello, ${name}! and there's no type information visible at all.

With user keywords typing is added directly to the variable used in the keyword name:

*** Keywords ***
Hello, ${name: str}!
    Log    ${name}

Also in this case Libdoc shows the original name, not arguments separately, but this time the name Hello, ${name: str}! contains type information. The type isn't clickable, though, so type documentation is not visible. This keyword doesn't show in type usages either.

Activity

  1. added theissue type on Jan 14, 2026
  2. pekkaklarck commented on Jan 14, 2026

    @pekkaklarck
    MemberAuthor

    I see two ways how this could be fixed:

    1. We could add type information to the keyword name also with library keywords and show Hello, ${name: str}! consistently with both keyword types. This probably would be easy, but we then needed to make the type part (str) clickable to make type documentation available. Currently the name is stored in Libdoc model just as a literal string, so we either needed to store it somehow separately to make types easily available or Libdoc UI needed to parse the name and handle types properly.
    2. Come up with a way how to show embedded argument types similarly as normal argument types are shown. The problematic part here is that nowadays keywords can accept normal and embedded arguments, and just showing embedded arguments with normal arguments would be very confusing. This would at least require some kind of a separate marker.
  3. pekkaklarck commented on Jan 14, 2026

    @pekkaklarck
    MemberAuthor

    I just noticed there's #5320, submitted nearly exactly a year ago, about the same topic but seemingly concentrating only on library keywords. I should have commented that instead of creating a new issue, but now that this issue already covers both keyword types and has more information in general, I believe it's better to close that issue as a duplicate of this one. Notice that the old issue has been submitted as a feature request but I consider this a bug.

    The old issue proposes showing type information separately similarly as the option 2. in my previous comment. It proposes a separate types section, though, which would be different to how types are shown with normal arguments. If we'd go that route, then we needed to show all types using that approach.

    I'll assign this issue RF 7.5 similarly as the old issue. It has already been moved from 7.3 to 7.4 and then to 7.5 apparently because it hasn't been considered that important and/or nobody has come up with a good way how to show the type information. Let's see when we actually get this implemented.

  4. added this to the v7.5 milestone on Jan 14, 2026
  5. pekkaklarck commented on Jan 14, 2026

    @pekkaklarck
    MemberAuthor

    @yanne, do you have any estimate how hard implementing option 1. in my earlier comment would be? It wouldn't require Libdoc model changes and would thus be simpler from backwards compatibility point of view. The possible hard part would be parsing names like Hello, ${name: str}! in Libdoc UI so that types (i.e. str) would be links to type docs the same way as with normal arguments. A benefit of this approach would be that no other UI changes would be needed.

    On the Python side the changes would be:

    • Add type to keyword name with library keywords.
    • Make sure that type docs are included with both kind of keywords and that usages are correct.
  6. self-assigned this
    on Apr 3, 2026
  7. modified the milestones: v7.5, v7.6 on Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions