Esempio n. 1
0
        private void ProcessResult(ReflectionEmitResult result)
        {
            _errorList.Items.Clear();

            if (!result.Success)
            {
                foreach (var diagnostic in result.Diagnostics)
                {
                    if (!diagnostic.Location.IsInSource)
                    {
                        throw new NotSupportedException("Only support source file locations.");
                    }

                    var itemType    = GetItemType(diagnostic.Info.Severity);
                    var description = diagnostic.Info.GetMessage();
                    var lineSpan    = diagnostic.Location.GetLineSpan(false);

                    _errorList.AddItem(itemType, description,
                                       lineSpan.Path,
                                       lineSpan.StartLinePosition.Line,
                                       lineSpan.StartLinePosition.Character,
                                       () =>
                    {
                        var openDocumentResult = new OpenDocumentResult(lineSpan.Path);
                        IoC.BuildUp(openDocumentResult);
                        openDocumentResult.Execute(null);
                    });
                }
            }

            if (result.IsUncollectible)
            {
                _errorList.AddItem(ErrorListItemType.Message, "The compiled assembly is not garbage collectible.");
            }
        }
 private void ProcessResult(EmitResult result)
 {
     foreach (var diagnostic in result.Diagnostics)
     {
         if (!diagnostic.Location.IsInSource)
         {
             throw new NotSupportedException("Only support source file locations.");
         }
         var itemType    = GetItemType(diagnostic.Severity);
         var description = diagnostic.GetMessage();
         var lineSpan    = diagnostic.Location.GetLineSpan();
         _errorList.AddItem(itemType, description,
                            lineSpan.Path,
                            lineSpan.StartLinePosition.Line,
                            lineSpan.StartLinePosition.Character,
                            () =>
         {
             var openDocumentResult = new OpenDocumentResult(lineSpan.Path);
             IoC.BuildUp(openDocumentResult);
             openDocumentResult.Execute(null);
         });
     }
 }
Esempio n. 3
0
 private void ProcessResult(EmitResult result)
 {
     foreach (var diagnostic in result.Diagnostics)
     {
         if (!diagnostic.Location.IsInSource)
         {
             throw new NotSupportedException("Only support source file locations.");
         }
         var itemType = GetItemType(diagnostic.Severity);
         var description = diagnostic.GetMessage();
         var lineSpan = diagnostic.Location.GetLineSpan();
         _errorList.AddItem(itemType, description,
             lineSpan.Path,
             lineSpan.StartLinePosition.Line,
             lineSpan.StartLinePosition.Character,
             () =>
             {
                 var openDocumentResult = new OpenDocumentResult(lineSpan.Path);
                 IoC.BuildUp(openDocumentResult);
                 openDocumentResult.Execute(null);
             });
     }
 }
Esempio n. 4
0
        private void ProcessResult(ReflectionEmitResult result)
        {
            _errorList.Items.Clear();

            if (!result.Success)
            {
                foreach (var diagnostic in result.Diagnostics)
                {
                    if (!diagnostic.Location.IsInSource)
                        throw new NotSupportedException("Only support source file locations.");

                    var itemType = GetItemType(diagnostic.Info.Severity);
                    var description = diagnostic.Info.GetMessage();
                    var lineSpan = diagnostic.Location.GetLineSpan(false);

                    _errorList.AddItem(itemType, description,
                        lineSpan.Path,
                        lineSpan.StartLinePosition.Line,
                        lineSpan.StartLinePosition.Character,
                        () =>
                        {
                            var openDocumentResult = new OpenDocumentResult(lineSpan.Path);
                            IoC.BuildUp(openDocumentResult);
                            openDocumentResult.Execute(null);
                        });
                }
            }

            if (result.IsUncollectible)
                _errorList.AddItem(ErrorListItemType.Message, "The compiled assembly is not garbage collectible.");
        }