Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable files imported as modules are not resolved #699

Closed
mlschmidt366 opened this issue Jun 27, 2022 · 2 comments
Closed

Variable files imported as modules are not resolved #699

mlschmidt366 opened this issue Jun 27, 2022 · 2 comments
Labels
bug Something isn't working robotframework-ls

Comments

@mlschmidt366
Copy link

Describe the bug
Since Robot Framework 5.0, variable files can be imported as modules, as described in the release notes. This new syntax does not seem to be recognized by the Language Server. The error 'Unresolved variable import' is shown instead.

To Reproduce
If a variable file is imported like
Variables module/subfolder/varfile.py,
then changing the line to use the new 'import as module' syntax will reproduce the error:
Variables module.subfolder.varfile.

Expected behavior
Both ways of defining the import should work. The import should be resolved correctly and variables that are defined in the imported file should hence not be marked as 'undefined variables'.
The new syntax is explained in more detail in the Robot Framework User Guide, section 2.8.2 Variable Files -> Taking variable files into use.

Versions:

  • OS: Windows 10
  • Robot Framework Version: 5.0
  • Robot Framework Language Server Version: 0.48
@mlschmidt366 mlschmidt366 added bug Something isn't working robotframework-ls labels Jun 27, 2022
@fabioz fabioz closed this as completed in 07ffb45 Jul 6, 2022
@fabioz
Copy link
Collaborator

fabioz commented Jul 6, 2022

Note: I've just published a pre-release (0.48.3) with the fix. If you're able to, please grab that version and test it...

@mlschmidt366
Copy link
Author

mlschmidt366 commented Jul 13, 2022

Thanks, works fine in my installation of VS Code. Now there's just one more thing, which is that class names are not recognized as variables... I'll create a new issue about that #704.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working robotframework-ls
Projects
None yet
Development

No branches or pull requests

2 participants