Sunday, March 30, 2008

Cola Visual Studio Integration

Typically the first question I am asked about Cola is whether it integrates with Visual Studio. "Integrates" is subjective, since Cola does both generate valid .NET CLR assemblies and can reference any other CLR assembly, but what folks really mean is "can I write Cola inside Visual Studio and compile, run and debug it." Up until today the answer was no...

Tonight I finished the initial plugin for VS 2005 using the VS SDK. (Boy do I hope the Eclipse integration is easier, but since the Java target for Cola is likely months away, I'll burn that bridge...).

If you don't know, VS SDK allows you to build extensions or plugins for Visual Studio that can do anything the builtin languages can do, since Microsoft uses VS SDK internally for the production languages. Several things we can do in Visual Studio as a plugin include:

  1. Recognize .cola source files and open an editor with syntax coloring, codesense or whatever else we want in the editor
  2. Provide and recognize a "Visual Cola" project with various project templates
  3. Compile the project from inside Visual Studio
  4. Run and debug (breakpoints, tracing, watches) Cola programs within Visual Studio

I accomplished (1) by instantiating the builtin C# editor since Cola is at least 90% source compatible with C# (and Java). We get basic keywords and constants and formatting but we don't get codesense. This requires a custom Cola language service which will come later.

(2) and (3) are done as well, but (4) will require a bit more work. Cola will generate a .pdb file (program debug database) but the debugging support still needs to be implemented in the VS plugin.

Just getting the basic framework for the plugin was a relief as I've been avoiding it for a long time. I am hoping to get a summer intern to work on fleshing out the Visual Studio integration for actual release. As of 0.102.0 its too rough to realistically use, as is colac due to its limitation of only accepting one .cola file at a time (no multi-file assemblies yet).

I'll post an update when it is done.

1 comment:

Unknown said...

first