Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RenameVariables does not update named arguments everywhere #712

Open
gohierf opened this issue Sep 4, 2024 · 1 comment
Open

RenameVariables does not update named arguments everywhere #712

gohierf opened this issue Sep 4, 2024 · 1 comment

Comments

@gohierf
Copy link

gohierf commented Sep 4, 2024

Following up on #711, I notice that RenameVariables works on keyword also applies to arguments (which is what I was looking for), but does not update the instances where these arguments are used with their name. Which is unfortunate since:

The named argument syntax is both case and space sensitive. The former means that if you have an argument arg, you must use it like arg=value, and neither Arg=value nor ARG=value works. The latter means that spaces are not allowed before the = sign, and possible spaces after it are considered part of the given value.

(source)

However, I am not sure robotidy can handle this as it requires applying the change across multiple files.
Maybe raising a warning on this subject could be enough? Or a default configuration to not apply to keyword arguments.

BEFORE
image

AFTER
image

CODE TO REPRODUCE

My Keyword
    [Arguments]    ${expected error}
    TRY
        No Operation
    EXCEPT    ${expected error}
        No Operation
    END

Another Keyword
    My Keyword    expected error=my error pattern

Side Note: When I use RobotCode "rename symbol" feature, it nicely updates the named arguments all over the project.

@bhirsz
Copy link
Member

bhirsz commented Sep 4, 2024

It's known limitation of the Robotidy. I recall it was mentioned somewhere but it may not be visible. It would be hard to implement behaviour similiar to 'rename symbol' as we would need to be 'project aware' rather than formatting files one by one. It may be worth to consider it in the future. For time being I will look into either proper warning or not changing arguments by default as it may lead to broken code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants