Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Syntax Highlighter in Visual Studio for Shopify .liquid Files

I'm currently working in a Shopify project which I have integrated to work locally. I'm using Visual Studio as my IDE which is super awesome. When working with .liquid files, I treat the extension to be opened with HTML editor with encoding. This is pretty sweet, but then I think it will be even better if I can have a syntax highlighting done for all the 'liquid' specific syntax, especially {% and %} since {{ and }} have been highlighted thanks to AngularJS syntax I reckon.

I found out that there are libraries to provide better intellisense, but not for .liquid files. What's the best way to get started with configuring a custom syntax highlighter? Will this be a quick process to do?

Screenshot: enter image description here

like image 704
kent-id Avatar asked May 31 '16 00:05

kent-id


People also ask

Does Visual Studio have syntax highlighting?

Syntax highlighting determines the color and style of source code displayed in the Visual Studio Code editor. It is responsible for colorizing keywords like if or for in JavaScript differently than strings and comments and variable names.

How do you add syntax highlights?

To add a syntax highlighting language, simply check its checkbox in the main list of languages. It will appear with a checkmark in bold font to show that it has been selected but not yet installed.


1 Answers

Seeing this question just received an upvote, let me post my solution here.

(Especially) For Windows Developers

Your best choice is to use VS Code, which is a lightweight, cross-platform source code editor by Microsoft. There's an extension called Liquid Languages Support by Neil Ding which I used

liquid-languages-support-syntax-highlight-SO-kent

Alternative: There seems to be a better extension called Shopify Liquid Template Snippets by Franky Lau, which I haven't tested. Can anyone who has used this share their insights?

Theme Kit

If you are looking on how to upload your local changes directly to your development theme, or an alternative workflow for Mac/Linux users, check out Shopify Theme Kit.

like image 95
kent-id Avatar answered Sep 18 '22 20:09

kent-id