robotcodedev / robotcode

Open Source Toolkit for Robot Framework, providing Language Server Protocol support, Debugger, VSCode Extension, PyCharm Plugin and powerful CLI tools

Home Page:https://robotcode.io

Repository from Github https://github.comrobotcodedev/robotcodeRepository from Github https://github.comrobotcodedev/robotcode

[Bug] <Ctrl + Left> .Resource ,the mouse poiton it's not turn to Resource

TianSen-Git opened this issue · comments

Describe the bug
.Resource ,the mouse poiton it's not turn to Resource

If possible add some example source code like:
公共组件.resource
*** Settings ***
Documentation 公共组件

*** Keywords ***
用例开始
[Arguments] ${name}
Log 1_${name}

Test1.robot
*** Settings ***
Library OperatingSystem
Resource 公共组件/公共组件.resource

*** Variables ***
${Base_Directory} ${CURDIR}

*** Test Cases ***
first
[Tags]
[Setup] 公共组件.用例开始 Start
Run Keyword And Continue On Failure Log ${Base_Directory}
[Teardown] Log Down

second
[Documentation] 测试用例2
Log 运行测试用例2

Screenshots/ Videos

Image

Pycharm [e.g. 2025.1.1]
plugins: robotcode4ij-1.2.0.zip
RobotCode Version [e.g. 1.2]
OS: [e.g. Windows, Linux]
Python Version [e.g. 3.13.2]
RobotFramework Version [e.g. 6.1.1]
Additional tools like robocop, robotidy

What exactly do you mean?

What exactly do you mean?

1.In LSP, Ctrl + MouseLeft at the method,it can turn to the method.
2.when i use Ctrl + MouseLeft at the method with robotcode in Test1.robot ,the mouse just turn to Settings in Test1.robot ,not turn to file 公共组件.resource

This is not a bug, but a feature in RobotCode. When importing a library or resource, a namespace or alias is defined for that import in the importing file. For example, with a library, you can change it using Library MyLibrary AS ml, and libraries can even be imported multiple times under different names. There's also frequent discussion about enabling this behavior for resource files as well.

That's why RobotCode jumps to the definition of this namespace/alias, not to the actual implementation.

I'm closing this one now, since it's the intended behavior. Thanks for reporting it anyway – always good to double-check! If anything’s still unclear, just drop a comment here.

This is not a bug, but a feature in RobotCode. When importing a library or resource, a namespace or alias is defined for that import in the importing file. For example, with a library, you can change it using , and libraries can even be imported multiple times under different names. There's also frequent discussion about enabling this behavior for resource files as well.Library MyLibrary AS ml

That's why RobotCode jumps to the definition of this namespace/alias, not to the actual implementation.

I'm closing this one now, since it's the intended behavior. Thanks for reporting it anyway – always good to double-check! If anything’s still unclear, just drop a comment here.

but in Robot Framework Language Server,it can turn to the actual implementation. i think RobotCode that can do this

Sorry, but this is not RFLS. Just because something works differently in RFLS doesn’t mean it will be implemented the same way in RobotCode.

To clarify once more: when I jump to the definition of an alias or namespace, RobotCode navigates to the relevant definition — in this case, that's the import statement.
From there, you can Ctrl+Click the import to navigate to the actual resource file.

If you have a different behavior in mind, feel free to open an enhancement request describing your suggestion. However, this is not a bug.

Sorry, but this is not RFLS. Just because something works differently in RFLS doesn’t mean it will be implemented the same way in RobotCode.

To clarify once more: when I jump to the definition of an alias or namespace, RobotCode navigates to the relevant definition — in this case, that's the import statement. From there, you can Ctrl+Click the import to navigate to the actual resource file.

If you have a different behavior in mind, feel free to open an enhancement request describing your suggestion. However, this is not a bug.

oh yes ,i agree with you ,thank you。