Exemple #1
0
        private async Task <bool> PrepareForCompiling()
        {
            try
            {
                _compilation = await _runner.GetCompilationAsync(_code);

                var tree = _compilation.CompilationObject.SyntaxTrees.Single();
                _diags = _compilation.CompilationObject.GetSemanticModel(tree).GetDiagnostics();

                _compiledCode = new LazyAsync <CompiledCode>
                                    (() => _runner.EmitFromCompilationAsync(_compilation));
            }
            catch (Exception e) when(!(e is CompilationErrorException))
            {
                WriteToConsole("Something went wrong with the _compilation\r\n");
                WriteToConsole("The error message is:\r\n");
                WriteToConsole("  " + e.Message);
                return(false);
            }

            return(true);
        }
Exemple #2
0
 public Task <CompiledCode> EmitFromCompilationAsync(CompilationWithSource compilation)
 {
     throw new NotImplementedException();
 }