lte2000 / intellibot

IntelliJ/PyCharm plugin for Robot Automation Framework
https://github.com/lte2000/intellibot
MIT License
91 stars 26 forks source link

support dynamic libraries #56

Open MichalChapko opened 1 year ago

MichalChapko commented 1 year ago

Hello is there a chance to add support for dynamic libraries in Intellibot? Currently i see only RIDE is supporting that and in my project its commonly used. Intellibot is not solving the keywords behind such a libraries.

lte2000 commented 1 year ago

Do the dynamic libraries mean the keyword name is got from the return value of method get_keyword_names like below? If so, it is not possible as this plugin only do lexical and syntax scan, it doesn't run code of script to get the value.

class DynamicExample:

    def get_keyword_names(self):
        # Get all attributes and their values from the library.
        attributes = [(name, getattr(self, name)) for name in dir(self)]
        # Filter out attributes that do not have 'robot_name' set.
        keywords = [(name, value) for name, value in attributes
                    if hasattr(value, 'robot_name')]
        # Return value of 'robot_name', if given, or the original 'name'.
        return [value.robot_name or name for name, value in keywords]

    def helper_method(self):
        # ...

    @keyword
    def keyword_method(self):
        # ...
MichalChapko commented 1 year ago

yes exactly that is an use case