Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] Navigate from python file to robot file #303

Open
nicolasbillamboz-flowbird opened this issue Aug 31, 2024 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@nicolasbillamboz-flowbird

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-flowbird nicolasbillamboz-flowbird added the question Further information is requested label Aug 31, 2024
@d-biehl
Copy link
Member

d-biehl commented Aug 31, 2024

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

@nicolasbillamboz-flowbird
Copy link
Author

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?

@d-biehl d-biehl changed the title [QUESTION] Navigate from python file robot file [ENHANCEMENT] Navigate from python file robot file Sep 1, 2024
@d-biehl d-biehl added enhancement New feature or request and removed question Further information is requested labels Sep 1, 2024
@d-biehl
Copy link
Member

d-biehl commented Sep 1, 2024

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.

@nicolasbillamboz-flowbird nicolasbillamboz-flowbird changed the title [ENHANCEMENT] Navigate from python file robot file [ENHANCEMENT] Navigate from python file to robot file Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants