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

"Missed mandatory argument" error for valid RF code #603

Closed
MrBIN89 opened this issue Mar 17, 2022 · 3 comments
Closed

"Missed mandatory argument" error for valid RF code #603

MrBIN89 opened this issue Mar 17, 2022 · 3 comments
Labels
bug Something isn't working P0 robotframework-ls

Comments

@MrBIN89
Copy link

MrBIN89 commented Mar 17, 2022

Describe the bug
VS Code complains about missing argument for valid RF code

To Reproduce
Code example below

*** Settings ***
Force Tags    vscode
*** Variables ***

*** Test Cases ***
My Test Case
    My Keyword    options \= value
    My Keyword    options \= value    opt=value
    My Keyword    specifiedText\=withEqual    opt=value

    My Keyword    text=options = value    opt=value
    My Keyword    text=specifiedText\=withEqual    opt=value

*** Keywords ***
My Keyword
    [Arguments]    ${text}    &{options}
    No Operation

Expected behavior
No red lines for the valid My Keyword calls

Screenshots
изображение

Versions:

  • OS: Windows 10
  • Robot Framework Version: 4.1.3
  • Robot Framework Language Server Version: v0.42.0
  • Client Version: VSCode 1.65.2
@MrBIN89 MrBIN89 added bug Something isn't working robotframework-ls labels Mar 17, 2022
@fabioz
Copy link
Collaborator

fabioz commented Mar 17, 2022

Thanks, the issue seems to be that the language server is not considering \ as an escape char for = so that it doesn't consider it a keyword argument but rather a regular positional argument.

Both the code-analysis as well as the semantic highlighting seem to be confused.

I'll make sure it's fixed for the next release.

@fabioz fabioz added the P0 label Mar 17, 2022
@MrBIN89
Copy link
Author

MrBIN89 commented Mar 17, 2022

I'm not sure that it is only related to \ character, though there is one more case when the language server complains about missing mandatory argument.
NOTE: There is no \ symbol, but it is still valid RF code

*** Settings ***
Force Tags    vscode
*** Variables ***

*** Test Cases ***
My Test Case
    My Keyword    options = value
    My Keyword    options = value    option_value

*** Keywords ***
My Keyword
    [Arguments]    ${text}    ${options}=${EMPTY}
    No Operation

изображение
And for the second keyword call the server incorrectly defines named argument syntax
изображение

@fabioz
Copy link
Collaborator

fabioz commented Mar 21, 2022

That's actually a different case -- and quite surprising to me actually because usually RF should normalize things to match a variable, so, I thought that options = value would be exactly the same as options= value, but it isn't...

Thanks for finding that ;)

@fabioz fabioz closed this as completed in fec6a85 Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0 robotframework-ls
Projects
None yet
Development

No branches or pull requests

2 participants