robotframework-lsp icon indicating copy to clipboard operation
robotframework-lsp copied to clipboard

The keyword: '<keyword>' is not used in this workspace error incorrectly thrown in certain circumstance

Open sparkymartin opened this issue 1 year ago • 0 comments

I have a .robot file that has a Keywords section at the end. One of those keywords is getting flagged by the linter as not being used when it actually is being used. The place it is being used is in a Suite Setup directive inside a BuiltIn.Run Keywords chain of keywords. Here is a very general example:

*** Settings ***
Resource  Path/To/Resource.resource
Documentation  Illustrating Linter Bug
Suite Setup  BuiltIn.Run Keywords  Resource.My General Setup
...  AND  My Specific Setup

*** Test Cases ***
Test One
    [Documentation]  This test does nothing
    BuiltIn.Log  message=Just a dummy test  level=INFO

*** Keywords ***
My Specific Setup
    [Documentation]  Specific setup steps for my test suite
    BuiltIn.Log  message=Just a dummy keyword  level=INFO

In the above case, the My Specific Setup keyword will be flagged as not being used in the workspace when it is, in fact. being used in Suite Setup.

sparkymartin avatar Sep 18 '23 19:09 sparkymartin