trannghia190 / robotframework-helper

4 stars 2 forks source link

"Replace for predefined variables" option #8

Closed Dymitriux closed 1 month ago

Dymitriux commented 1 month ago

In description we have information that plugin allow us to replace predefined variables, I need something like that, where I can add my own predefined variable that will be used in resorces path. Adding it in "Robot option" under "Library or resource path variable" is not working as predefined variable and resourcees are show as "Import file not found" in PyCharm, so quick navigation is not working, like some other option.

So if I want to add my own predefined variable I should add it in "Robot option" under "Library or resource path variable" in some special format or somewhere else?

trannghia190 commented 1 month ago

Could u give me an example of your use case?

The "Library or resource path variable" can help u replace the variable in the path Example:

# With full correct path:
Resource    ./folder_dev/file_name.robot

# If I set the variable in 'Library or resource path variable' with key = "env" and value = "dev". Then I can replace it with the variable and still redirect to the correct file
Resource    ./folder_${env}/file_name.robot
Dymitriux commented 1 month ago

Example project structure screenshot:

image

Library in "Settings" with absolute path works, can be quick navigated etc., but for Resources is not working in the same way (import file not found), that is why even after adding path to project and variable like that:

'Library or resource path variable' key = "abs_path" and value = "C:/Projects/Python/pythonProject" Resource ${abs_path}/resources/resources.robot

it didin't work.

I was using previously "Robot Framework Language Server", there was support for that, but now I'm searching for different plugin. Is there a chance that there will be added support for that here also in future?

trannghia190 commented 1 month ago

I still can not get your point. Are u mentioning the case same as lines 2 and 3 in the following image? As in the image, it successfully navigates in both 4 ways (both absolute path and relative path)

image
Dymitriux commented 1 month ago

Case on line 2 work, but case on line 3 not, quick navigation is not working and KW in line 9 is marked as not found as he don't see import file. In case of Library (line 4) it works fine, added it for comparison.

So problem is that when I give full path from C drive in Resource it can't find import file. Maybe it is because windows os?

trannghia190 commented 1 month ago

Seem like have an issue with finding the absolute path on Windows OS. Since I not using a Win, so I will try to debug this case on another machine. Thanks for ur reporting.

trannghia190 commented 1 month ago

will be fixed in the next version - 1.2.7.2 expect it to be approved on the market within two business days