Language Designer Suggestions

SyntaxEditor for WPF Forum

Posted 9 years ago by Phil Devaney - Senior Software Engineer, Serck Controls Ltd
Version: 10.2.0531
Avatar
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

Comments (4)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Phil,

Thanks for the suggestions, we've added them to our TODO list. It may make sense to put the .g in the name for all of them as they are generated files and it would help indicate to you which are generated and which are not. Also if we did that then the non-.g versions could be partial class implementations of your own.


Actipro Software Support

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hello,

For the third suggestion, you might find it useful to subclass the generated SyntaxLanguage, and then use the derived one in your application. The derived class constructor would need to call the base class constructor, and it also sets up any additional services that are required.


Actipro Software Support

Posted 5 years ago by Matt Gerrans
Avatar

I guess there is still no command line tool for generating the .g.cs files?

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Matt,

Sorry, no we never made a command line tool.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.