Exemple #1
0
        protected CodeGenerator(IDirectoryProvider directoryProvider, IAnalyzerManager analyzerManager)
        {
            var projectPath = Path.Combine(directoryProvider.GetSolutionDirectory().FullName, @"src\ProblemTemplateGenerator.Cli\ProblemTemplateGenerator.Cli.csproj");
            var analyzer    = analyzerManager.GetProject(projectPath);

            Workspace = analyzer.GetWorkspace();

            UnitSyntax = CompilationUnit();
            UnitSyntax = UnitSyntax.AddUsings(new[]
            {
                UsingDirective(ParseName("System")),
                UsingDirective(ParseName("System.Collections")),
                UsingDirective(ParseName("System.Collections.Generic")),
                UsingDirective(ParseName("System.Linq")),
                UsingDirective(ParseName("System.Text"))
            });
        }