Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In Jet Brains family IDEs (not sure how they call the go one) you can use Inject language or reference option to get most of editor support (inspections,highlighting,intellisense etc.) for snippets of one language embedd in files of another language. I've been using it with JS scripts inside custom xml for a while and it works pretty well.


JetBrains "Inject" is fine for contiguous embeds like JS in XML, but doesn't cut it for inline intertwined string-templating.

E.g. (from the article):

  <a class="button {{if .IsPrimary}}primary{{end}}" {{if eq .IsSubmit true}}type="submit"{{else}} href="{{.Link}}"{{end}}>


Thanks for this; JetBrains stuff continues to amaze me. Its blessing and curse is the incredible breadth of functionality I keep learning about.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: