Spark Language Package - Preview 1
spark, visual studio December 19th, 2008This is a very early copy of a msi which installs a Spark language package for Visual Studio 2008. It will put dlls into a Program Files\Spark directory and add just enough registry keys to add color and intellisense to files with a .spark extension.
Download Now Update: This link is obsolete - please visit the download page for the latest release bits.
I’ve tested installing and uninstalling which will remove the files and registry entries.
Eventually there may be a single installer that contains the VSIP files in addition to the things currently in the zip download - but for now they’re entirely separate. The copy of Spark.dll installed by the msi is used used by the language service for parsing and colorizing. It won’t conflict with the Spark.dll in the zip download, and that’s the file you should continue to use as an assembly reference in your projects.
As always feedback is welcomed.
Update: There’s been a report of “no effect” on XP sp2. I should also mention the installer has no user interface, so it’s normal for it for a small dialog box to show a progress bar move back and forth a bit then disappear without confirmation.
Also the spark file will need to be “Open With…” the “Source Code (Text) Editor” in case you’re using the xml or html editor.
Further Update: If you’re adding namespaces in the web.config or as code in global.asax they won’t be seen. Until that’s fixed try adding a Views\Shared\_global.spark file to hold things like:
<use namespace="System.Collections.Generic"/> <use namespace="System.Linq"/> <use namespace="System.Web.Mvc.Html"/> <use namespace="MyApp.Models"/>
December 20th, 2008 at 2:02 pm
it does not pickup and extensions methods where does it look for the using namespaces because i do not have the spark configuration i the web.config file but in a spark.config file
December 22nd, 2008 at 9:28 am
[...] DeJardin has posted a preview of Spark Language integration with Visual Studio. Spark is a view engine for ASP.NET MVC and [...]
December 23rd, 2008 at 2:09 am
Awesome. Seems to work well. I can’t seem to get intellisense to work if I have R# intellisense enabled though. I have to switch back to VS intellisense. Makes sense I suppose, but it’d be nice if I could get both.
Also, I don’t auto complete closing tags.. would it be possible to support intellisense in an unclosed tag? This is great though, keep it up.
December 31st, 2008 at 2:21 am
@Subnus try preview 2 - the config information should be used now
@Aaron I noticed that too - though the hotkeys (ctrl+space, ctrl+shift+space) still seemed to work even with resharper enabled. That’s definitely a high priority.
Which type of tags do you mean? Html tags or the ${} syntax?
December 31st, 2008 at 3:14 am
I’m referring to both ${} and tags. If you type ${foo. then intellisense doesn’t work, but if you type ${} and then go back and type foo. it seems to.
December 31st, 2008 at 1:55 pm
Try grabbing preview 2 - the } should be added automatically for you.
http://groups.google.com/group/spark-dev/browse_thread/thread/1301c5fc7adbb1ca
To be honest I’m not really sure what direction to take the tags. The big drawback to making a language service is you lose the VS support in the Html/Xml editors for schema, outlining, format-document, completion of end tags and attribute quotes.
Some of those can be annoying - colorized text is a bit extreme. I’ve always liked how the Xml editor’s indentation rules for formatting helped to validate the structure was correct.
January 2nd, 2009 at 4:47 am
[...] Spark Language Package - Preview 1 - The Spark Language, which has had mention here before as a view engine for ASP.NET MVC gets its first installer which installs the DLL’s needed and adds registry keys to add colour and intellisense to .spark files in Visual Studio 2008 [...]
January 2nd, 2009 at 6:21 am
Heh - reminds me of the old joke - you know you’ve been working on computers for too long when 256 seems like a nice round number
January 8th, 2009 at 8:23 pm
I hear Spark from Haaked’s ASP.NET MVC Northwind Demo Using the Spark View Engine ;The Spark bring us what ?
how about it’s performance ?
January 10th, 2009 at 1:57 pm
All of the .spark files being rendered are used to generate and load a csharp class with a RenderView() method, so the performance is very good. The type is re-used for the same view/master each time so all it’s creating an instance, setting context, and calling RenderView.
The code like ${product.Name} and each=”var item in Items” turns into compiled code like Output.Write(H(product.Name)); and foreach(var item in Items) {…}.
So really the view engine doesn’t have any language or interpreter built into it at all - it’s a class generator.
One benefit it brings is a smaller, text/html friendly file format. There are other features like declaring helper functions (macro) in the template language instead of in csharp language.