VSCode extension for syntax highlighting discourse-plugin javascript

Hi, I made VSCode extension for highlighting javascript in discourse plugin script tags

On Marketplace: Discourse JS plugin syntax highlighting (HTML) - Visual Studio Marketplace

On Github: https://github.com/zcuric/vscode-discourse-plugin (:star: if you like it)

As I said here Developer’s guide to Discourse Themes - #55 my goal is to make a discourse plugin api extension.

Feedback and contributions welcome.

9 Likes

Great idea! I’ve noticed that issue. Thanks very much for making this as I’m a huge VSCode fan.

Might want to be careful with nomenclature though? A Theme Component is not a “Plugin” as such. That distinction is important because javascript highlighting works pretty well already with javascript Plugin files. And indeed it works fine in a Theme Component if residing in the javascripts folder.

I’ll have a go at using this and report any issues! Cheers!

3 Likes

Yes. It’s confusing, because the script tag is marked as type text/discourse-plugin not text/discourse-theme-component. And the API is called PluginAPI :sweat_smile:. I’ll think about it.

Regarding regular plugin js highlighting, it’s just javascript, not javascript in .html so it works out of the box.

Thanks! :+1:

3 Likes