Robotframework-lsp do not find keywords imported relatively
See original GitHub issueI have xeus-robot and robotframework-lsp installed in my environement. I have a keywords.robot
file containing:
*** Settings ***
Library String
*** Keywords ***
This Is A Dummy KeyWord
Convert To Lower Case "HELLO"
And a Notebook running xeus-robot next to it:
The problem is that it doesn’t find the keywords defined in keywords.robot
that is imported relatively.
Although we saw that there was a .virtual_documents
directory created, that seem to contain files that were opened from JupyterLab and that are used by jupyterlab-lsp. It seems that once keywords.robot
is added to this .virtual_documents
directory it works and the keywords are found properly.
I cannot seem to be able to reproduce the issue in Python (having a local python module next to a Notebook), is there something special that python-language-server does?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
LSP library search path does not match Robot Framework #266
Robot Framework searches relative library imports based on sys.path as a fallback. LSP only searches relative to the working directory.
Read more >VSCode new Create Robot Project can't find Python Keywords
Return code: 252 Output: Importing test library 'Library.py' failed: Module 'Library' does not contain 'py'. Try --help for usage information.
Read more >robotframework-lsp - PyPI
Casing of keywords from libraries used in code-completion can be configured. Go to definition for keywords, variables, resource imports and library imports.
Read more >RequestsLibrary always shows red in RIDE - Google Groups
Most probable is RIDE not finding the library spec. If you right click (context menu) over the red Library import, there should be...
Read more >Robotframework dictionary problem for help - Robot Framework
Hi, I am trying to extract keywords from resources into my test case, but it is showing import file not found. hw can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Now seeing https://github.com/krassowski/jupyterlab-lsp/issues/537, it seems that’s the same request as this…
I think the main issue is that you’re seeing the use-case where the
.robot
is embedded in a notebook (where the notebook is usually standalone and thus theuri
in the.virtual_documents
may make sense) vs. a case where the user opens a.robot
file directly, where the original uri should be kept.Although even in the case where it’s in a notebook, a concrete file in the
.virtual_documents
may not really be needed (just keeping the contents in memory and passing the original uri postfixed by.robot
may be better as the language server can then search for other – actual.robot
files in the filesystem).It’s then the job of the language server to actually know how to work with partial contents in-memory or in-disk.