robotcodedev / robotcode

RobotFramework support for Visual Studio Code
https://robotcode.io
Apache License 2.0
168 stars 13 forks source link

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

Closed crayfishuk closed 9 months ago

crayfishuk commented 9 months ago

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):

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

d-biehl commented 9 months ago

ok, probably optimized a little too much ;-)