Posted 14 years ago
by Phil Devaney
-
Senior Software Engineer,
Serck Controls Ltd
Version: 10.2.0531

Hi,
I have a number of suggestions for the Language Designer to make it easier to integrate the generated code into a C# project.
The relatively simple ones:
1. An option to name the generated files *.g.cs or *.Designer.cs, so they can be ignored by StyleCop.
2. An option to make some or all of the generated classes internal.
3. Add a partial method to the generated SyntaxLanguage called RegisterAdditionalServices or similar, and call this method in the constructor. I can then add an implementation in a non-generated class to register services such as a parser & completion provider, without worrying about the code being lost if the file is regenerated.
And the more complicated one :):
4. Write a custom build tool so that a langdef file can be added to a csproj or vbproj, and auto-generate the language classes, similar to the way a resx file generates the strongly-typed resource class. If you wanted to go all out, you could create a Visual Studio extension so the langdef file can be edited inside VS!
Phil
I have a number of suggestions for the Language Designer to make it easier to integrate the generated code into a C# project.
The relatively simple ones:
1. An option to name the generated files *.g.cs or *.Designer.cs, so they can be ignored by StyleCop.
2. An option to make some or all of the generated classes internal.
3. Add a partial method to the generated SyntaxLanguage called RegisterAdditionalServices or similar, and call this method in the constructor. I can then add an implementation in a non-generated class to register services such as a parser & completion provider, without worrying about the code being lost if the file is regenerated.
And the more complicated one :):
4. Write a custom build tool so that a langdef file can be added to a csproj or vbproj, and auto-generate the language classes, similar to the way a resx file generates the strongly-typed resource class. If you wanted to go all out, you could create a Visual Studio extension so the langdef file can be edited inside VS!
Phil