robotcodedev / robotcode

RobotFramework support for Visual Studio Code
https://robotcode.io
Apache License 2.0
168 stars 13 forks source link

[BUG] Keyword cannot be found when several test-lib instances exist #250

Closed Noordsestern closed 2 months ago

Noordsestern commented 2 months ago

📣 If you consider this change useful, we may have budget for this 💸

Describe the bug I want to import a test-instance library that has dynamic keywords. In order to distinguish the libraries, i give them names with AS.

Robotcode though only seems to find keywords from the first library instance and ignores the others.

When executing robotframework, robot does find the keywords from the other library instances.

To Reproduce Consider following test suite:

*** Settings ***
Library     EggplantLibrary    suite=${CURDIR}/eggplant/dummy.suite
Library     EggplantLibrary    suite=${CURDIR}/eggplant/suite1.suite    AS    Suite1Library
Library     EggplantLibrary    suite=${CURDIR}/eggplant/suite2.suite    AS    Suite2Library

*** Test Cases ***
Script Demo
    EggplantLibrary.Connect SUT    127.0.0.1
    # This keyword cannot be found by robotcode, but by robot framework
    Suite1Library.Mein Script1

Expected behavior Keywords from all test-instance libraries are found during autocomplection.

Desktop (please complete the following information):

d-biehl commented 2 months ago

He,

search in the VSCode Settings for the setting robotcode.analysis.cache.ignoredLibraries and add EggplantLibrary to it. Be sure you are doing this at the Workspace tab in the setting.

Or put the following code to your .vscode/settings.json

    "robotcode.analysis.cache.ignoredLibraries": [
        "EggplantLibrary"
    ],

After that run the command RobotCode: Clear Cache and Restart Language Servers via F1

📣 I can use the budget maybe for other things 😉 💸

Noordsestern commented 2 months ago

You're too good :)

That worked!