robotcodedev / robotcode

RobotFramework support for Visual Studio Code
https://robotcode.io
Apache License 2.0
173 stars 14 forks source link

[BUG] Intellisense doesn't work when importing yml file with variables #143

Closed ThekkTheDwarf closed 1 year ago

ThekkTheDwarf commented 1 year ago

Describe the bug When you add a variableFile to the workspace settings, Intellisense/autocomplete/etc doesn't work and keeps the 'Loading...' status.

We use these files to pass variables per environment (dev/tst/...).

To Reproduce Steps to reproduce the behavior:

  1. Go to Workspace Settings of Robot Framework in VS Code
  2. Add ${workspaceFolder}/variables/tst.yml
  3. Open a .robot file with a Library.
  4. Hover over the defined library
  5. You only see 'Loading...'

This is just an example, other functions don't work either.

Running the tests and debugging does work.

Expected behavior See the library information.

Logs Copy the messages from VSCode "Output" view for RobotCode and RobotCode Language Server for the specific folder/workspace.

Desktop (please complete the following information):

Additional context pyyaml is installed, etc.

d-biehl commented 1 year ago

thank you very much for your report,

I hope you mean the "robotcode.robot.variableFiles" settings.

I think there is a bug in handling ${...} in variable paths, I need to investigate this a bit more.

But the main problem is that something like ${workspaceFolder} is not supported in the variableFiles settings.

Can you try adding just ./variables/tst.yml or variables/tst.yml (without ${workspaceFolder}!!!!) and see if it runs and give me feedback?

ThekkTheDwarf commented 1 year ago

We did use the correct option robotcode.robot.variableFiles. And it does work with the ./variables/tst.yml.

Thanks!

ThekkTheDwarf commented 1 year ago

It does still complain about missing variables in the files that are using them. Example, the tst.yml contains BASE_URL: https://test.org If you use ${BASE_URL} in a .robot or .resource file, robotcode complains about "Variable '${BASE_URL}' not found.robotcode.namespace(VariableNotFound)"

It does work when running the tests.

d-biehl commented 1 year ago

Ok, I have found it. I will create a new version tonight.

d-biehl commented 1 year ago

The bug is fixed and a new version is published. I close this issue, if it not works correctly you can reopen the issue.