[BUG] RobotCode InteliJ plugin could not recognize source root as PYTHONPATH
Describe the bug Current run configuration will not mark source root/content root but Python run configuration supports that.
Steps To Reproduce Steps to reproduce the behavior:
- Init a project with directory 'testcases' to store robot files.
- Prepare a 'library' directory to store my Python files and Mark this as a source root
- Check robot file editor
- All imports by 'Library' keywords warned as 'No module named 'xxx' found '
If possible add some example source code like:
***Settings***
Library common.geo.geotools
***Test Cases***
a simple test
do something # this should shown something
Desktop (please complete the following information):
- RobotCode Version [latest]
- OS: [Windows]
- Python Version [3.11]
- RobotFramework Version [4.1.3]
Since IT department restricts upload screenshot to github, I am willing to push more information literally for you if needed. Thanks.
I know this feature of from IntelliJ, but I did not use it for python projects because there are some standards on how to setup python projects and there are python project manager like poetry or hatch. If you use these manager all python path things are handled by these managers.
RobotCode has also a default settings, just create a lib folder instead a library folder. And you can use a robot.toml file to define the python path for robot framework projects.
But because this seems to be a common feature in PyCharm, maybe you can provide a little more information, maybe a screenshot and how you are working with this? If so, we can convert this bug description to an enhancement request.
it is a bit confusing when users manually configure the extension paths in robot.toml. My idea is that RobotCode can directly get those folders marked as source root paths and add them to the recognized PYTHONPATH since it's a useful and common feature that IntelliJ has.
I reinstalled the system and used the latest IDEA Ultimate and 2025.1.1.1, as well as Robotframework 7.2.2.
It is very regrettable that this problem occurred during run the configuration (I need to investigate this further), so I couldn't reproduce the second of two:
- IntelliSense failed as above.
- ModuleNotFoundError in robot frame work runtime (Not reproducible at this time).
I have somewhat forgotten the specific scenario of this problem, it should be divided into two cases.
This can be solved by adding a new robot.toml configuration, but I hope there will be enhanced features.
Same applies to .resource files. Unlike other plugins, RobotCode does not honor the folders marked as "Sources" in PyCharm's "Project Structure" settings. This makes this plugin unusable for our project until this is solved.