Skip to content

[BUG] Single resource file with different relative paths is not seen as same file #173

@crayfishuk

Description

@crayfishuk

Describe the bug
When a common resource file is imported multiple times using relative paths (e.g. ../../../resources/my.resource) but the file locations are different, any robot file that includes those resource files will see the resource file repeated in the auto-complete list, and the keywords are incorrectly shown as multiply declared

To Reproduce
Steps to reproduce the behavior:

  1. Make a resource and folder called in /resource/MyResource.resource and declare a keyword ( 'My Keyword') in it
  2. Create a new folder/resource file called /resource/folder1/Second.resource and include the original as '../MyResource.resource'
  3. Create a test file called /tests/mytest.robot and include the original file as '../resource/MyResource.resource'
  4. Use the My Keyword as 'MyResource.My Keyword'
  5. Note that the auto-complete shows 'MyResource' as showing up twice with different paths:
    -----root/resource/folder1/../MyResource.resource
    -----root/tests/../resource/MyResourse.resource
  6. They are both the same file - but not being recognised as such.

Expected behavior
The single file should only be recognised as a single entity.

Screenshots/ Videos
image

In the image above the file is in /resource/common/Globals.resource -- but the paths are being seen as different so the resource is duplicated.

Logs
Copy the messages from VSCode "Output" view for RobotCode and RobotCode Language Server for the specific folder/workspace.

Desktop (please complete the following information):

  • VS Code Version 1.83.1
  • RobotCode Version 0.62.0
  • OS: Windows 11 Pro
  • Python Version 3.11.4
  • RobotFramework Version 6.11

Additional context
Works fine in 0.61.7 -- only appeared in 0.62.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions