robotframework-lsp icon indicating copy to clipboard operation
robotframework-lsp copied to clipboard

Entries in robot.variables not available for libdoc

Open DanielPenning opened this issue 2 years ago • 1 comments

Describe the bug We use a robot variable to store a path to a user library. Running the suite or test from within VS Code works fine. However when the plugin tries to create the libdoc, an errors is raised and no library documentation is available. The outpot shows that the robot variable cannot be resolved.

To Reproduce Steps to reproduce the behavior:

  1. Add a variable in .vscode/settings.json
    "robot.variables": { 
        "own_app_dir": "${workspaceFolder}/abc/app"
        }
  1. Add a robot test and use this variable inside the path to a custom foo.py library:

Library ${own_app_dir}/foo.py

  1. Add any library as foo.py in the abc/app folder inside your workspace.

  2. Run command "Robot Framework: Clear caches and restart Robot Framework Language Server"

  3. The output log for "Robot Framework" shows an error and all keywords from the foo library are underlined in red (no doc available).

server-api: 2023-08-01 14:51:01 UTC pid: 15312 - ThreadPoolExecutor-0_1 - INFO - robotframework_ls.impl.variable_resolve
Cannot resolve variable: ${own_app_dir}

Expected behavior Robot variables inside library paths are parsed for libdoc.

Versions:

  • OS: Windows 10
  • Robot Framework Version: Robot Framework 6.1 (Python 3.10.6 on win32)
  • Robot Framework Language Server Version: v1.11.0
  • Client Version: VSCode 1.80.2

DanielPenning avatar Aug 01 '23 12:08 DanielPenning

Note: This problem sometimes disappears when VS Code is restarted. Documentation is then available. However the problem reappears immediately after calling "Robot Framework: Clear caches and restart Robot Framework Language erver" manually

DanielPenning avatar Aug 01 '23 13:08 DanielPenning