alphagov / govuk-prototype-kit

Rapidly create HTML prototypes of GOV.UK services
https://prototype-kit.service.gov.uk
MIT License
304 stars 236 forks source link

Participants confused by VS code highlighting Nunjucks function calls in red #871

Open 36degrees opened 4 years ago

36degrees commented 4 years ago

This issue was observed whilst facilitating Prototype Kit training in Manchester on 20 February 2020.

Multiple participants were confused by the way that VS Code highlighted the checked function in red, as they thought they had done something wrong.

image

I believe this is happening because the Prototype Kit uses .html for views, so the syntax highlighter is trying to highlight it as HTML.

If you change the language mode to Nunjucks (Cmd-Shift-P > Change Language Mode) the problem goes away.

36degrees commented 4 years ago

We could consider changing the file extension to .njk which would make the default highlighting mode correct.

trang-erskine commented 3 years ago

Also check if this happens with the new training documentation.

joelanman commented 1 year ago

we now have experimental support for .njk. I'm not sure if thats enough or we may need to tell people to install Nunjucks support in their code editor