Skip to content

[BUG] Keyword not recognized when prefixed in same file #590

@damgut

Description

@damgut

Describe the bug
RobotCode reports KeywordNotFound and cannot Go to Definition for a keyword call that uses a qualified prefix referencing the same resource file.

Steps To Reproduce
Create a file "myresouce.robot" in VS Code with RobotCode enabled.
Define a keyword in the same file and call it using a namespace prefix, e.g. MyResource.keyword name
Ctrl+Click on the prefixed call -> See error No keyword with name 'MyResource....' found. robotcode(KeywordNotFound) and navigation fails.

Expected behavior
RobotCode should resolve this call and allow Go to Definition to jump to the local keyword definition in the same resource file

Example

*** Settings ***
Library     Collections

*** Keywords ***
Login Keyword
  [Documentation]  this is a login keyword
  Log  hello

Login Keyword Is Opened
  MyResource.Login Keyword           <-- keyword not found (prefix of the same file)
  Login Keyword                      <-- ok (no prefix)
  BuiltIn.Log To Console  test 1     <-- ok (prefix other file)

Screenshot
Image

Desktop
VS Code Version: 1.113.0
RobotCode Version: 2.4.0
OS: Ubuntu 24.04.4 LTS
Python Version: 3.10.6
RobotFramework Version: 6.1.1

Metadata

Metadata

Assignees

No one assigned

    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