Comments (9)
I went ahead and created a pull request with the changes we made to support the built-in ${EXECDIR} variable in Resource and Library path references.
With this fix, instead of having to use messy relative paths like this:
Library ../../../Path/To/File/MyLibrary.py
Resource ../../../Path/To/File/MyResource.robot
You can use absolute paths with the ${EXECDIR} variable referencing the root of your project like this:
Library ${EXECDIR}/Path/To/File/MyLibrary.py
Resource ${EXECDIR}/Path/To/File/MyResource.robot
And still be able to resolve the keyword names and navigate between keywords in the IDE using the usual Ctrl+B or Command+B.
from intellibot.
@sparkymartin , I'm not working on it. You're the contributor :)
Indeed, our projects also use variable in library path (please see the screenshot below):
We are using the method of "Strip Variable in library path" I described in previous comment (that's why I develop such feature), it works very well.
from intellibot.
${EXECDIR}: An absolute path to the directory where test execution was started from.
This is a running time variable. You can start execution from any directory. So can't know the value during static parse.
For work around, you can create a fake directory named "EXECDIR" in Pycharm project, put or link Settings.robot in it. Or you may link the directory "EXECDIR" directly. Or change your directory hierarchy, e.g, change from /home/tester/repo/ to /home/tester/EXECDIR/repo/
Then in Pycharm, menu, File | Settings | Languages & Frameworks | Robot Options, Check "Strip Variable in library path (${name}/ to be name/)".
After that, when it see "${EXECDIR}/Settings.robot", it will search "EXECDIR/Settings.robot".
from intellibot.
I have a forked version of the original intellibot plugin that solves this exact issue (and is the only reason we created our own version to begin with). I would be happy to share how we solved it if you like. I would much rather this be fixed in your version of the plugin so I can stop maintaining my own. The only files we changed to implement this functionality are RobotFileManager.java and RobotPythonReferenceSearch.java.
from intellibot.
@sparkymartin Thanks for the code sharing.
I see you replace ${EXECDIR} to project.getBasePath(). I believe this works well in your environment.
But I checked several projects in our organization. Some ${EXECDIR} are users's home directory, other ${EXECDIR} are Jenkins's workspace, none of them set to project.getBasePath().
So I suggest could your add a field in Settings | Languages & Frameworks | Robot Options to let user input what's value of ${EXECDIR}. And add a flag in same page to enable/disable this feature.
Thanks!
from intellibot.
Good point @lte2000. This code was actually written by a previous intern and employee who are no longer with my team. The environment that they used to build and test this is no longer available. Is this something that you would be able to add to the code? I just simply wanted to share how we solved it, but if there is fine tuning to be made to make it a more widely acceptable solution, I am fine with whatever tweaks need to be made to make it usable by anyone. I am just not in a position to easily make further changes.
from intellibot.
@lte2000, is adding the setting to the Robot Options page something that you or another contributor can do?
from intellibot.
now, you can provide the value for any variable yourself in Robot Option.
For example, input:
${EXECDIR}=/path/to/execution
${ANYVAR}=/path/to/VAR
Then
Library ${EXECDIR}/aa/bb/${ANYVAR}/lib.py
will be
Library /path/to/execution/aa/bb/path/to/VAR/lib.py
Note: it just do simple string replacement, no any other function.
Please try dev_0.10.143.397 from https://github.com/lte2000/intellibot
from intellibot.
please install "intellibot #patched" v0.10.143.397 from jetbrain marketplace, which can define value the ${EXECDIR} so can resolve the import path.
from intellibot.
Related Issues (20)
- There is no release or commits on github for 0.13.191.8026
- Support Robot Framework 5.0 HOT 4
- intellibot does not resolve environmental variables like %{ROBOT_ROOT} HOT 2
- IntelliBot #Patched causes Inspections freeze on some robot files HOT 1
- No images show in generated log file
- very high CPU usage ~ 55-70% HOT 2
- intellibot v0.14.191.8026 Pycharm exception HOT 6
- Intellibot 0.14.191.8026 ArrayIndexOutOfBoundsException HOT 8
- [v0.14.191.8026] Exception: Argument for @NotNull parameter 'baseDir' while comparing two branches in PyCharm CE HOT 6
- support dynamic libraries HOT 2
- Document how to build the plugin HOT 5
- intellibot v0.15.191.8026 Pycharm exception HOT 3
- intellibot.jar not working
- intellibot v0.16.191.8026 Pycharm exception HOT 1
- 2 to 4 spaces as a configurable setting HOT 2
- intellibot@seleniumLibrary exception HOT 2
- robotframe work issue
- pycharm intellibot#patched issue HOT 2
- Error while indexing rpaframework-assistant
- Cannot distinguish StubFileElementTypes exception
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intellibot.