robotcodedev / robotcode

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

[QUESTION] python path configuration and pyproject.toml support #300

Open adamweld opened 2 weeks ago

adamweld commented 2 weeks ago

Hi, first of all, thank you for this project, it's really great and already quite helpful.

I was wondering, what is the suggested way to add a custom libraries directory for the extension?

I am trying the following robot.toml file: python-path = [ "/src/my_package/libraries" ] output-dir = [ "output" ]

however with this file created, intellisense seems to break and I am no longer able to follow function definitions.

PS, it would be great to support pyproject.toml configuration e.g. under [tool.robotidy] which I understand is generally interchangeable with robot.toml

d-biehl commented 2 weeks ago

if your libraries are in your project folder then you must use relative paths in the python-path setting.

python-path = [ "src/my_package/libraries" ]
output-dir = [ "output" ]

and yes you can also use thy pyproject.toml, but to separate the things a little bit better, there is the robot.toml Everything regarding python goes to the pyproject.toml and everything regarding robot goes to the robot.toml

In a pyproject.toml we use the prefix tool.robot, so your example above should look like

[tool.robot]
python-path = [ "src/my_package/libraries" ]
output-dir = [ "output" ]