1

I would like to use Scriban as a code generator and VSCode as an editor. Ideally, I would like Intellisense and syntax coloring for editing templates along with the ability to generate and preview the output on save. Unfortunately,there's a dearth of information on how to achieve this using the Scriban Plugin for VSCode. There's also a SiteCore Scriban plugin, but it's unclear if it requires the SiteCore platform.

ATL_DEV
  • 9,256
  • 11
  • 60
  • 102
  • I would love this as well. To me, code completion and type checking is as important as getting the right output from the template. – Joshua Frank Sep 01 '22 at 11:55
  • @JoshuaFrank Isn't it hilarious? It reminds me of the Apollo missions. We are still technically impressed by sending astronauts to orbit a few hundred miles above the earth, despite having already sent astronauts 250,000 to the moon and back over 50 years ago. Likewise, we had T4 years ago, and despite its imperfections, was at least a practical solution. Fast forward to today, we no longer have any decent tools for template-based source code generation. – ATL_DEV Sep 01 '22 at 18:48
  • I do indeed find it quite strange that such an obviously useful tool doesn't exist. I've been using RazorEngine, but that has lots of issues and hasn't been updated in years. T4 still exists, and I do use it, but it's just so hard to work with. What I'd really like is a fusion of T4 and Scriban, so you could use all of .NET in the code portion, with Intellisense and coloring, but literal text outside of that, for emitting that portion of the template. I want this so much that I'm tempted to try to build it, but it seems quite difficult. – Joshua Frank Sep 02 '22 at 13:45
  • @JoshuaFrank There are open-source T4 implementations but I couldn't get any of them to work. I can't recall the reasons, but they either lacked IntelliSense, or I couldn't get them to work properly. I certainly go for it. There's a ton of useful code that can save you a ton of time. As a starting point, I would look at SiteCore's Scriban VSCode extension. It supposedly offers Intellisense and syntax coloring, but it seemed geared specifically for its content management system. It might be easy enough to just feed it with reflection metadata. – ATL_DEV Sep 02 '22 at 16:28

0 Answers0