HyperRobotFrameworkPlugin
HyperRobotFrameworkPlugin copied to clipboard
Keywords prefixed by resource/library don't offer autocomplete
If I have an imported resource file, I'm not getting code completion hints when using the resource.keyword notation, e.g.
*** Settings *** Library Collections Resource my_resource.resource
*** Keywords *** my_resource.my_keyword ${myList} create list Collections.log list ${myList}
In the above, I'm not getting code completion when entering my_resource, or when entering Collections into the pycharm IDE.
the library/resource name prefix can be omitted.
*** Settings ***
Library Collections
Resource my_resource.resource
*** Keywords ***
my_keyword
${myList} create list
log list ${myList}
in plugin 0.1.17 you can use library alias:
*** Settings ***
Library Collections AS c
Resource my_resource.resource
*** Keywords ***
my_keyword
c.create list ...
while for resource alias is not supported yet.
Hello there - I'm not actually looking for/interested in aliases. I'm just looking for code completion when entering a library/resource name.keyword - just basic code completion when operating in that fashion.
Like I mentioned, you do not need to add library/resource name. prefix, unless you have multi same name kw in different imported libraries, resources, in this case, you need to use the aliases. Please try to directly input the kw.
For me it is not clear. Why should I create an alias for a library name, when I could use the library name as a prefix?
Like I mentioned, you do not need to add
library/resource name.prefix, unless you have multi same name kw in different imported libraries, resources, in this case, you need to use the aliases. Please try to directly input the kw.
Please read the bold lines.
I understood this part, this was not my question.
Lets say I have the following structure:
Kewords
A.robot
SomeKeyword
B.robot
SomeKeyword
In this case, I have same name keyword, with different named robot files, so we can make a difference by the robot file names. So, why should we make:
Library A AS A_alias
Library B AS B_alias
Keyword
A_alias.SomeKeyword
B_alias.SomeKeyword
Instead of more easier use:
Library A
Library B
Keyword
A.SomeKeyword
B.SomeKeyword
Aliases should be used only when our robot file names are also identical, in this case I don't see the practical use.
I see, this is a non documented robot feature, looks like this:
- Import python file library / resource file like:
Library foo/bar/lib.py/Resource foo/bar/lib.resource - Then you can use the file name
libas the alias likelib.my kw
I didn't know this feature before, so plugin does not support that.
When to use robot lib alias, please check: https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#library-name
Actually, this is a documented feature: https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#specifying-a-keyword-explicitly
But you are right with the alias, it is not only useful in identical file names.
So based on this doc, can I request code completion support when I type the Libary name with a dot?
Thanks for sharing, I'll add this to my TODO list.
Hello - I can see that this one was closed, but (at the same time) on your TODO list; does that mean that this is still 'open' , and will receive a change?
Sorry, this should be reopened and marked as enhancement.