The LINQ over C# project is one of my pet peeves; I started it in the May of 2007. The goal of the project was to create a LINQ provider for C# language that would run over textual C# files to allow querying source code information directly on these files. Such queries would be like “What are the most complex methods in a class?” or “What are the local variables that are declared far from their real usage scope?”, etc.
I dehydrated the project in the beginning of 2008 after creating a syntax parser for C# 3.0. Then my attention turned to Visual Studio Extensibility and started new projects like LearnVSXNow! and VSXtra.
However, a few weeks ago I decided to go on with development of LINQ over C#. I got several serious drivers to carry on:
C# 4.0 is coming with great new language constructs. LINQ over C# should support the new syntax and semantics
Visual Studio Extensibility does not provide a good way to access the syntax tree of a C# (or a VB) source code file. Through the VSX code model you can navigate to types and members, but cannot go into the syntax tree within a member’s body.
I wanted to create a writeable model of a C# syntax tree where I can create my own syntax tree (in an easier and much simpler way then with CodeDOM) or inject new nodes into the syntax tree and then emit C# source code.
I hope, in a few weeks I’ll be able to present you some basic proof-of-concept models about how I progress. Please, stay tuned!
Posted
Mar 26 2009, 08:28 AM
by
inovak