jerome chabrol
jerome chabrol

Reputation: 13

robotframework_ls didn't detect local keywords with coc nvim

I'm using neovim with coc extension. I add the robotframework_ls server for lsp.

My project is stored in the following directory: /home/jchabrol/personaltools/robot with the following tree: keywords (with all .resource keywords) tests (with all .robot test file)

My coc-settings.json is like this:

{
  "languageserver": {
    "robotframework_ls": {
        "command": "robotframework_ls",
        "filetypes": ["robot"],
        "settings": {
          "robot.lint.robocop.enabled":true,
          "robot.pythonpath":["~/robot",
            "${workspaceFolder}/robot"
          ]
        }
    }
  }
}

When I open a test .robot file the coc or lsp server didn't find local keyworkenter image description here

or

enter image description here

I try different configuration without any results.

Upvotes: 0

Views: 93

Answers (1)

Sam Maksymyshyn
Sam Maksymyshyn

Reputation: 519

The draft guess is that there is an issue with path importing for resource if you use relative paths.

The relative path to the resource file is relative to the test location.
Then, your relative-style import path could look like

Resource   ../../keywords/my_simulator.resource

Where:

  • The ../../ part is the path 'up' from a test to the project root. E.g., if the test is located in tests\folder\tests.robot
  • keywords/my_simulator.resource is the path down from the project root to the resource file.

Here is more information in the official User Guide: 2.8.1 Resource files

Upvotes: 0

Related Questions