openpetra / openpetra

OpenPetra is an administration software (CRM+ERP) for charities
https://www.openpetra.org
GNU General Public License v3.0
116 stars 49 forks source link

switch C# parser to support C# 7 #435

Open tpokorra opened 4 years ago

tpokorra commented 4 years ago

this is not an issue yet. We use NRefactory for code generation: https://github.com/icsharpcode/NRefactory It seems this is not being developed anymore, and therefore we will get issues if we start using newer features of the C# language.

An alternative would be to switch to Microsoft.CodeAnalysis.CSharp parser from the Roslyn compiler?

tpokorra commented 4 years ago

a core file is: https://github.com/openpetra/openpetra/blob/master/csharp/ICT/BuildTools/CodeGeneration/CSParser.cs that heavily references NRefactory.

It is used for example by https://github.com/openpetra/openpetra/tree/master/csharp/ICT/BuildTools/GenerateGlue, which is used to generate the API endpoints that you can view here: https://demo.openpetra.org/api/ It is called by nant generateGlue

An initial Tutorial for CodeAnalysis with Roslyn is here: https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/get-started/syntax-analysis

tpokorra commented 3 years ago

see https://www.nuget.org/packages/Microsoft.CodeAnalysis or https://www.nuget.org/packages/Microsoft.CodeAnalysis.CSharp