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

Keywords not imported correctly when resource path contains ${CURDIR} #449

Closed
wwuoti opened this issue Sep 21, 2021 · 3 comments
Closed
Labels
enhancement New feature or request robotframework-ls

Comments

@wwuoti
Copy link

wwuoti commented Sep 21, 2021

When specifying a resource with a path containing CURDIR, the path to the resource is not resolved.

Consider the following example:

curdir_import_test.zip

curdir_import_test
|--resource_folder
|   |--resource1.robot
|--test_importing_from_curdir.robot

resource1.robot:

*** Keywords ***
Keyword In Resource File
    Log To Console    Test keyword in resource file

But when the resource is imported in test-importing_form_curdir.robot
image

Removing ${CURDIR} from the file path fixes this issue:

image

@fabioz fabioz closed this as completed Sep 21, 2021
@fabioz fabioz reopened this Sep 21, 2021
@fabioz
Copy link
Collaborator

fabioz commented Sep 21, 2021

Actually, reopening, I had misunderstood CURDIR... it maps the current directory of the .robot or .resource, thus, the language server should support it.

As a note, I don't really see any reason to use CURDIR at that context (since you can just make the path relative), but the language server should support it anyways.

@ORicardoSouza
Copy link

@wwuoti
seems to be ok, just merge?

@arnewohletz
Copy link

I had a similar issue and resolved it by specifying a custom variable in my project's settings.json (here on Windows):

{
  "robot.variables": {
		  "RESOURCES":"C:\\my_project\\Resources",
	  }
}

Reference: Configuration setting

Then using it like this:

*** Settings ***
Resource      ${RESOURCES}/my_resource.robot

Naturally for Robot Framework, I needed to define the same variable (e.g. in a variable file) and pass it as parameter (using either --variable or --variablefile) to my robot test runs.

@fabioz fabioz added enhancement New feature or request P0 robotframework-ls labels Oct 12, 2021
fabioz added a commit that referenced this issue Oct 18, 2021
@fabioz fabioz closed this as completed in 1cd6dc3 Oct 18, 2021
@fabioz fabioz removed the P0 label Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request robotframework-ls
Projects
None yet
Development

No branches or pull requests

4 participants