robotcode icon indicating copy to clipboard operation
robotcode copied to clipboard

[ENHANCEMENT] Navigate from python file to robot file

Open nicolasbillamboz-arrive opened this issue 1 year ago • 3 comments

When I use "Find All References" from a function implemented in a python file, the usages in robot files are not found. Is this feature implemented? If so, is there something to configure? If not, could this feature be implemented?

Note: I'm able to navigate from robot file to python file with "Go to Definition"

  • VS Code: 1.92.2
  • RobotCode: v0.87.0
  • OS: Linux
  • Python: 3.11.9
  • RobotFramework: 6.1.1

nicolasbillamboz-arrive avatar Aug 31 '24 10:08 nicolasbillamboz-arrive

No this is not possible, because the RobotCode language server only knows robot files and if you import a library into a robot file, robot framework only get line numbers from python.

The trick here is, instead going to the python function/method and try to find all references from here, you can also use "Find All References" from a keyword call in a robot/resource file and you will get all location where this keyword is used in robot/resource files

d-biehl avatar Aug 31 '24 12:08 d-biehl

Thx for the quick reply. I know that I can still workaround this by using search tool, or going to a usage in a robot file and using "Find All References", but this is still a bit frustrating. Is there any chance to see this feature implemented? Is it conceivable that the language server listens to python files only for this purpose?

nicolasbillamboz-arrive avatar Sep 01 '24 08:09 nicolasbillamboz-arrive

Listen also for Python files is easy, but finding the exact position of a declaration can be tricky since the RobotFramework Libdoc tool, which RobotCode uses internally, only provides the start line numbers of the methods/functions in the Python file. Additionally, there are dynamic libraries like remote libraries that do not provide a line number and so on.

I have changed this issue to an enhancement so that we don’t forget about it and can take a closer look at it later.

d-biehl avatar Sep 01 '24 10:09 d-biehl