Open axi92 opened 2 years ago
The issue here is that python 2.7 is not supported...
So, given that you're explicitly using "robot.python.executable": "/usr/bin/python2.7"
in the config, this won't work.
p.s.: The requirements (https://github.com/robocorp/robotframework-lsp/tree/master/robotframework-ls#requirements) do say that 3.7 onwards is needed, but a better error message could probably be given.
Ty I upgraded everything and it works better now. Any ideas on how I get those to work that the plugin recognizes them?
Ty I upgraded everything and it works better now. Any ideas on how I get those to work that the plugin recognizes them?
Usually this is because it wasn't possible to generate the libspec for the related library (you can see OUTPUT > Robot Framework
for any tracebacks doing that).
https://github.com/robocorp/robotframework-lsp/blob/master/robotframework-ls/docs/faq.md#how-to-proceed-if-keywords-from-a-library-are-not-being-resolved has some more info on how to deal with that.
Ok I think I know why it is not able to find them I imported them with
Resource ${ROOT_DIR}/Keywords/OPCUA/OpcUA.robot
The ROOT_DIR is defined in my red.xml that was my fix because RED was also having problems with it.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<projectConfiguration>
<configVersion>2</configVersion>
<relativeTo>WORKSPACE</relativeTo>
<variable name="${ROOT_DIR}" value="/home/user/repo/system-life-cycle/"/>
And this is also in my GlobalVariable.robot file:
*** Settings ***
Resource ${ROOT_DIR}/Keywords/OPCUA/OpcUA.robot
*** Variables ***
${ROOT_DIR} /home/user/repo/system-life-cycle
Robotframework got no issue with that. Any Idea on how I can fix this in vscode?
PS: If you like me to create a new issue for that I can do that too =)
If you set that variable value for the language server it should work too.
See: https://github.com/robocorp/robotframework-lsp/blob/master/robotframework-ls/docs/faq.md#how-to-specify-a-variable-needed-to-resolve-some-library-or-resource-import how to do that.
As a note, the docs aren't entirely correct. You can use the following variables:
${workspace}, ${workspaceRoot}, ${workspaceFolder}
and ${env.ENV_NAME_VARIABLE}
or ${env:ENV_NAME_VARIABLE}
for the value of robot variables (this was added but docs still don't reflect that).
I'll update the docs to address shortly...
Thank you @fabioz for helping me with my issues. Should I close the ticket or do you let it open as a task for the Error message improvement?
You can leave it open (as I repurposed it to provide a better error in this case in the future...).
Describe the problem I am not able to get it to work at all.
To Reproduce
Screenshots
Versions:
Logs
settings.json