After having read this topic:
https://community.looker.com/open-source-projects-78/anyone-interested-in-a-vscode-plugin-9353 many times, I decided to give it a shot. I was told by Looker Staff that they can’t share the regular expressions for the grammar for internal reasons and, as suspected, the red tape due to being sold to Google.
I tried to do it on my own in my spare time since it seemed like a cool project. I did it with the help of the code that Ladvien has already written (https://github.com/Ladvien/vscode-looker)
This is just a first try and proof of concept. The colours are crazy just so that I can easily differentiate between different patterns 🙂 In terms of grammar recognition I believe It’s close to what we have in the LookML editor, and perhaps slightly more. (recognising the SQL in SQL parameters (where we could use SQL grammar recognition that I think Ladvien had in mind), values in arrays, and so on)
Let me know what other things would be useful in terms of syntax highlighting and here is a list of what I’ve done so far:
Did not colourise the parenthesis as I’m using a separate extension called Bracket Pair Colorizer 2 that works in all languages and helps me identify matching parenthesis.
Let me know if there’s anything else that would be useful in the syntax highlighting and whether it’s a plugin that you would be useful for you. I’m still learning the grammar and how to name and reference it properly.
These are the settings that then can be used to change colours of the different part of the syntax: