Add RobotFramework library arguments support
See original GitHub issueProblem description.
For now, robocorp.robotframework-lsp-0.9.1 falls with error
Error creating libspec: SomeLibrary.
Return code: 252
Output:
Library 'SomeLibrary' expected 2 to 3 arguments, got 0.
if any count of args required for a user RobotFramework library.
Possible solution
Probably robotframework-lsp could detect a types of arguments using typehints and use this info to generate lib specs with the correct libdoc call. If it’s not possible then some kind of configuration option could be provided in setting.json to match lib name and default arguments. Or it could be any other special description file in the workspace.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Robot Framework User Guide
The setup.py script accepts several arguments allowing, for example, installation into a non-default location that does not require administrative rights. It ...
Read more >Robot Framework cheat sheet and quick reference - Robocorp
Use it in your daily development to look up how to work with tasks, keywords, arguments, for loops, conditional if / else /...
Read more >Support keyword-only arguments in Python 3 libraries #2555
If library contains function like function(*variable_arguments, __helper_functions) import failed with [ ERROR ] Adding keyword 'function' ...
Read more >Importing libraries with parameters writen in Python to Robot ...
The typical solution for this is to make the arguments to your library optional. That way tools like libdoc or eclipse can import...
Read more >Create Custom Robot Framework Libraries
Robot Framework supports numerous libraries which can be used ... the Retrieve Employees List by adding the APPLICATION_PATH as an argument, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Cool! Thank you. I’ll try it.
Update: It actually works! Awesome! I can just put
<package>.<RobotLib>.libspecfile into my python package which contains a RobotFramework library and LSP can find it without any problems! Here is an example of a libdoc call for a libspec generation for lib with two args:The usual command line would be:
python -m robot.libdoc --format XML:HTML <library_name> <library_name.libspec>As you have custom usage for the parameters, you may want to take a look at:
python -m robot.libdoc -hto see how to tackle that.You can just place the
.libspecunder a file anywhere in the workspace or directly under some entry in the PYTHONPATH and the language server should find it.