I always have this red color in every file that I open, what's wrong? I use VS Code

Hi all,
I always have this red color in every file that I open, what’s wrong?
it says : "Undefined keyword: … "
did I miss something ? plugins?

I already install Robot Framework Language Server, Robot Code, and Robot-Framework-Formatter
and I have this version of RF and Python
Robot Framework 6.0.2 (Python 3.11.1 on win32)

This generally indicates to the language server not using the correct Python interpreter.

Also note that you should use either Robot Framework Language Server or Robot Code, not both. I’m not familiar with Robot-Framework-Formatter, but both RFLS and RC offer such functionality, so I would not use it with either of them.

I would suggest choosing either RFLS or RC, disable the other plugins, then Ctrl+Shift+P → Python: Select Interpreter and choose the correct one, then Ctrl+Shift+P → (RFLS or RC): Clear Cache and restart language server.

1 Like

Did you ever figure this out?

Do you get the issue with any keywords that aren’t from the Browser Library?

For me, it usually just means I don’t have the correct resource specified in the Settings section of that file (this can happen in Keyword files where it won’t cause issues when running as long as the Test file has the Resource specified). However, I have not been able to fix the issue for Browser keywords as the extension cannot generate the libspec for it. I suspect this has something to do with initializing the library.

thanks! this works

How make it correct if I use devcontainer?
My robot libraries are installed from a separate private package in a devcontainer.
I hope (but strongly doubt) that it is possible to make the language server using the python interpreter and my libraries from the devcontainer.

Doubling interpreter environments sounds silly. Installation of packages requires accessing a private package index, where access is protected with a token.

Is there a good way to solve it?

If you’re in a devcontainer, Ctrl+Shift+PPython: Selelct Interpreter should allow you to select the Python interpreter (either system or venv, depending on your workflow). Once you’ve done that, a pip list in the shell should show you the expected packages and the language server should pick everything up.