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

[Enhancement] Intellisense suggests private keywords from other files

Lakitna opened this issue · comments

Describe the bug

When using Intellisense to auto complete a keyword: The list of available keywords includes keywords tagged with robot:private. Keywords tagged like this should not be used outside the file where they are defined. Robot Framework userguide on the topic.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Make a .resource file
  2. Add 2 keywords to the file
  3. Tag 1 of the keywords with robot:private
  4. Make a .robot file
  5. Add a test
  6. Add the private keyword using Intellisense (autocomplete)

If possible add some example source code like:

# foo.resource
*** Keywords ***
Some Public Keyword
    No Operation

Some Private Keyword
    [Tags]    robot:private
    No Operation
# bar.robot
*** Settings ***
Resource    ./foo.resource

*** Test Cases ***
My Amazing Test Case
    Some P
  1. Place cursor after P
  2. Hit ctrl + space
  3. Note that both keywords from foo.resource show up.

Expected behavior

Private keywords should not be suggested outside the file where they're created.

Screenshots/ Videos

Image

Logs

N/A

Additional context

N/A

Desktop (please complete the following information):

  • VS Code Version 1.103.1
  • RobotCode Version 1.8.0
  • OS: Windows
  • Python Version 3.13.2
  • RobotFramework Version 7.3.2
  • Additional tools like robocop, robotidy: N/A

I think this should be an enhancement.

  • maybe there should be an option to enable/disable this

An option to enable/disable never hurts! I think this should be enabled (don't suggest) by default since Robot Framework will warn about using private keywords from another file during runtime.