Skip to content

Wrong argument hint color when using inline keyword arguments #2466

Open

Description

@JFoederer

The most prominent issue with highlighting I am running into now concerns operator keywords. Binary operator keywords are placed in between its arguments for readability. The highlighting expects additional arguments at the end that are already processed. In practise this means that my test cases are now cluttered with red cells, as in this basic example:
image

I typically use this natural language extension (robotnl) in Robot framework tests. It allows me to rewrite a basic construction like
image

In the more natural form
image

This method does however lean heavily on using inline keyword arguments. In a recent update argument highlighting changed. It now also highlights arguments for inline keyword arguments, where previously only the first keyword was considered. There are however some issues with determining which argument belongs to which keyword. See also this discussion on Robot framework issue 3187

I do like the idea of having hints for all keywords, but for now it might be safer to not support inline keyword argument highlighting. In my opinion showing too much red is worse than missing a hint in some complex situations.

Activity

  1. JFoederer commented on Jul 19, 2022

    @JFoederer
    CollaboratorAuthor

    A few more situations to complete the picture
    image

  2. added
    enhancementRequest for improvement: either for an existing feature or a new one
    on Jul 19, 2022
  3. JFoederer commented on Jul 25, 2022

    @JFoederer
    CollaboratorAuthor

    Optional arguments with a single inline keyword argument also presents some issues:
    image
    def Keyword_with_optional_arguments(self, number, arg2=None, arg3=None, arg4=None):

    The first two lines have correct highlighting
    The third line uses the keyword twelve inline (takes no arguments). Optional arguments for primary keyword are not shown in light grey.
    The last line uses an inline kw argument, but also the optional arguments for the primary keyword. Now the optional arguments are falsely marked red.

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

    enhancementRequest for improvement: either for an existing feature or a new one

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions