If a Library has a variable in the path, arguments are not found
Describe the bug If a Library has a variable in the path, arguments are not found I have replicated the issue in the included zip file, but here's the gist of it:
BrokenExample.robot
*** Settings ***
Library ${ROOT}/libs/Example.py ${EXAMPLE}
.vscode/settings.json
{
"robot.variables": {"ROOT":"${workspaceFolder}", "EXAMPLE":"hello"},
"robot.libraries.libdoc.needsArgs": ["../libs/Example.py"]
}
I've tried various different ways to use the needsArgs here:
["../libs/Example.py", "Example", "${ROOT}/libs/Example.py"]
None of them seem to fix the issue.
The library is unresolved and i get the following error
Unresolved library: ${ROOT}/libs/Example.py.
Error generating libspec:
Library 'Example' expected 1 argument, got 0.
Consider using default arguments in the ${ROOT}/libs/Example.py constructor and
calling the "Robot Framework: Clear caches and restart" action or
adding "${ROOT}/libs/Example.py" to the "robot.libraries.libdoc.needsArgs"
setting to pass the typed arguments when generating the libspec.
To Reproduce Steps to reproduce the behavior:
- Download the included zip
- Open it in VSCode
- Try various different parameters and the problem persists: The LS can't find the Example.py file and/or the parameter.
Expected behavior
The LS would resolve the Library and it's path as normal, like when using ../libs/Example.py
Versions:
- OS: Windows 10, Debian 11, Fedora 37 KDE
- Robot Framework Version: 6.0.2
- Robot Framework Language Server Version: 1.9.0
- Client Version: VSCode 1.76
Logs logs.zip
Bug example project BrokenExample.zip
From what I've gathered, it seems the ROOT variable is not resolved during the time when the docs are generated, so it doesn't match anything in the robot.libraries.libdoc.needsArgs