robotcodedev / robotcode

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

[BUG] Show keywords for multiple instances of libraries with dynamic API[BUG] <title> #176

Closed SimonWalbrun closed 8 months ago

SimonWalbrun commented 8 months ago

Describe the bug If several instances of a library with dynamic API are loaded, but they provide different keywords, only the keywords of the first instance are displayed for both instances.

To Reproduce

***Settings***
Library    LibWithDynamicAPI    config_file=first set of keywords          AS    Lib1
Library    LibWithDynamicAPI    config_file=second set of keywords     AS     Lib2

*** Keywords ***

Keyword which is found by Extension
    Lib1.Keywords_of_Lib1     #Keyword is found by Robot Code

Keyword which is NOT found by Extension
    Lib2.Keywords_of_Lib2    #Keyword is NOT found by Robot Code   ------------------------ Not resolved keyword

As I try to show in the example, a library with dynamic robot api is not resolved right

d-biehl commented 8 months ago

Keywords in a library are normally cached by default so that they are not redetermined with every VSCode session and every import. This brings some performance, especially when starting VSCode. Sometimes it is not possible to do this, e.g. when using the Remote library with different endpoints. For this there is the setting robotcode.analysis.cache.ignoredLibraries, here you can add libraries that should not be cached. They are determined anew each time they are called in a file. Search for robotcode.analysis.cache.ignoredLibraries in the settings and simply add your library or add something like this directly to your .vscode/settings.json:

"robotcode.analysis.cache.ignoredLibraries": [
  "LibWithDynamicAPI"
]

After you change this setting you have to execute the command Robot Code: Clear Cache and Restart Language Servers by pressing F1 and then typing the command name.

SimonWalbrun commented 8 months ago

Thanks a lot! Fixed the problem completely!