mtrubs / intellibot

IntelliJ/PyCharm plugin for Robot Automation Framework
https://github.com/millennialmedia/intellibot/wiki
MIT License
158 stars 109 forks source link

Intellibot doesn't recognize KWs in Python libraries imported from a Resource file #159

Open CMTaylor opened 8 years ago

CMTaylor commented 8 years ago

Intellibot doesn't recognize KWs that are implemented as methods in Python libraries imported from a Resource file. The libraries are in the standard C:\Python27\Lib\site-packages location and can be seen when looking at the Python interpreter settings in PyCharm.

mtrubs commented 8 years ago

do you have an example?

CMTaylor commented 8 years ago

I stripped down my proprietary setup to a small simple example that I could share:

[cid:image001.png@01D19950.E6A34C30]

I then realized that this issue is probably caused by your #155 issue about defining built-in variables. I hope your fix actually defines them in the same way that RF does, because simple “white-listing” them, as suggested in issue #155, is not sufficient. I use variables like ${OUTPUT_DIR} in the initialization of my Python libraries (see last Library line above). If you rely on a successful import of the library in order to recognize its KWs then you MUST define all the RF variables that may be passed to such a library.

Another way you could choose to handle this is to load and use the .xml files that RIDE uses for KW libraries. This would also get you the ability to pop up KW help with ctrl-space like RIDE does. This is a very helpful feature in RIDE and would be a great addition to intellibot and PyCharm.

BUT… further experimentation with the example shows that this issue is actually other deficiencies in the intellibot implementation of RF’s KW rules. Here’s my example test case in PyCharm:

[cid:image002.png@01D19952.7DBE0C30]

It seems that intellibot doesn’t have the smarts to map library KW methods (e.g. ClearInputLines) to acceptable RF KW syntax such as “Clear Input Lines”. RIDE does this very well. The style for RF test case authoring is that all KWs are Space Separated Title Case. RIDE maps any implemented KW method such as ClearInputLines or clear_input_lines to Clear Input Lines for consistent test case appearance without caring how the library authors implemented their KW method names. RIDE would also accept, and recognize as KWs, names that the test author chooses to change the capitalization, such as “Wait for Input Lines”.

Thanks, Martin

From: Matthew Rubino [mailto:notifications@github.com] Sent: Sunday, April 17, 2016 12:38 PM To: millennialmedia/intellibot Cc: Taylor, Martin Subject: Re: [millennialmedia/intellibot] Intellibot doesn't recognize KWs in Python libraries imported from a Resource file (#159)

do you have an example?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHubhttps://github.com/millennialmedia/intellibot/issues/159#issuecomment-211066952

mtrubs commented 8 years ago

So #155 will handle the definition of such variables as well as code completion. Context is something I plan to tackle next ie ${CURDIR} == '/home/user/me/project' and then using that type of value for path resolution and such. I think that is what you are getting at, yes?