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

Support Import Library keyword #675

Closed
Reddriver opened this issue May 12, 2022 · 2 comments
Closed

Support Import Library keyword #675

Reddriver opened this issue May 12, 2022 · 2 comments
Labels
enhancement New feature or request robotframework-ls

Comments

@Reddriver
Copy link

Reddriver commented May 12, 2022

I have a script with dynamic import of Dialogs library and I call KW Pause Execution inside IF block. So, I would like to ignore error in Problems tab: ,,Undefined keyword: Pause Execution" in Visual Studio Code (Robot Framework Language Server). Is there a way to ignore one line with error?

We use dialogs lib on local station for pause test on failure (classic run, not in debug mode VS). Dialogs lib can't be import on openshift, that is the reason for this code. I don't know .libspec, but I'll try study or we will stop using dialogs (we run in debug mode more often)

I imagined there is something like Keyword That Is Longer Than Allowed Line Length ${arg} # robotidy: off in robotidy, just ignore one line.

*** Keywords ***
Teardown KW
    [Documentation]  teardown
    IF  not ${OPENSHIFT}
        Run Keyword If Test Failed  Pause Execution  Test skončil s chybou:\n${TEST_MESSAGE}
    END

*** Test Cases ***
Test
    ${isOpenshift}  Set Variable If  "%{KUBERNETES_PORT=}"  True  False
    Set Global Variable  ${OPENSHIFT}
    IF  ${OPENSHIFT}
        Import Library  Dialogs
    END
@Reddriver Reddriver added enhancement New feature or request robotframework-ls labels May 12, 2022
@fabioz fabioz changed the title Dynamic import of Dialogs library, KWs are underline Support Import Library keyword May 12, 2022
@fabioz fabioz closed this as completed in 478ebf8 May 18, 2022
@fabioz
Copy link
Collaborator

fabioz commented May 18, 2022

This should now be working. Please test if it does work for you in the latest pre-release (`0.47.5').

@Reddriver
Copy link
Author

@fabioz I tested this enhancement on v0.47.6 and it worked, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request robotframework-ls
Projects
None yet
Development

No branches or pull requests

2 participants