Code/syntax highlighting of extension'Robot Framework Language Server' version v0.17.0 and upwards is 'off'

Hi,

I’ve been using the latest version of Microsoft VS Code to write my testcases for Robot Framework on a Windows 8.1 based virtual desktop. I’ve installed the ‘Robot Framework Language Server’ extension, which took care of both IntelliSense and syntax highlighting.

Very recently I received a new virtual desktop, this time based on Windows 10.
On this virtual desktop I installed Robot Framework and VS Code and in VS Code the above mentioned extension again, just as I had done on my Windows 8 based virtual desktop.

After installation on my Windows 10 I noticed that the highlighting of the Robot Framework code is ‘off’. The closing square braces have a different color than the opening square braces.

While trying to find a possible cause or solution for this problem, I downgraded the extension from its current and most recent version 0.18.0 to version 0.13.1. This fixed the syntax highlighting issue. The opening and closing square braces match in color.

From version 0.13.1 I gradually upgraded the extension, each time reloading the workspace and checking my existing Robot Framework code to see if the syntax highlighting was still OK. This way I noticed that the issue of the syntax highlighting being ‘off’ was introduced in version 0.17.0.

So I would like to report this as a bug. But I don’t know how to go about it.
Or maybe its a user error… :wink:

Thanks in advance.

Out of curiosity :smiley: Are you using any themes for Code?

Hi Raivo,

I’ve checked the themes. It seems that VS Code uses the theme “Dark+ (default dark)” by default after installation. This theme causes the syntax highlighting to be ‘off’, it shows the opening square parentheses in a different color than the closing one.

I changed the theme to “Dark (Visual Studio)” and all the ‘off’ syntax highlight coloring was fixed.

So I tried all themes available by default and have found several themes that have the same problem:

  • Light+ (default light)
  • Quiet Light
  • Abyss
  • Dark+ (default dark)
  • Kimbie Dark
  • Monokai
  • Monokai Dimmed
  • Red
  • Tomorrow Night Blue
  • High Contrast

The below themes DON’T have the issue mentioned above:

  • Light (Visual Studio)
  • Solarized Light
  • Dark+ (Visual Studio)
  • Polarized Dark

I’m sticking with theme “Dark+ (Visual Studio)” for now.

This still leaves the question why the ‘off’ coloring of the syntax was introduced with ‘Robot Framework Language Server’ version 0.17.0 and still exists in the most recent version (0.18.0).

Thanks for your help.

1 Like

Sorry for the delay.

My first guess would be the RobotFramework version somehow causing this or some extension collision.
Do you have our Robocorp Code extension installed? If yes you can submit an issue report via Command Palette > Robocorp: Submit issue
…this gets us the logs to see what might be causing this.

Br, Kari

Hello Kari,

Thanks for your reply.

I currently have only the Robot Framework Language Server by Robocorp installed.
What does the Robocorp Code extension do and/or what does it enable me to do?

I’ve tried to install it, but I get an error that my system does not have Long Path Support enabled.
Because my computer is a corporate computer and because of several restrictions and policies I cannot enable Long Path Support.

Kind regards,
Victor

Hi,
Basically, what the Code extension brings in the “power of RCC:wink:
This means the environment control. So you don’t have to install x versions of Python etc on your machine but rather you just define a conda.yaml file into your robot and the dependencies listed there get installed in an isolated way so that your machine does not get polluted and vice-versa your robot execution happens in the same environment on any machine.

For the code completion case what the Code extension would do is it loads in the dependencies you have defined into an environment where the LSP can get all the libraries you have defined in the environment you are currently working on.

Without the Code extension, you need to have your system variables in place for the VsCode and LSP to be able to find all the things needed in PATH and PYTHON_PATH.

You could also be affected by the VsCode default Python plugin A/B experiment: More here. We might now have a way to solve this, but need to verify this.

The long paths limitation is a tough nut to crack and one would hope Microsoft would set that as a default sooner rather than later. We wrote the step-by-step guide specifically for corporate IT, so if you are able to contact them the group policy setting should be quite a straightforward thing to do and we have no knowledge on any negative effects with this setting (it has been around for years, but for some reason still not as default).

Br, Kari