public async Task TemplateErrorReporterCreatesErrorItemsThatNavigateToSourceOfError()
        {
            await UIThreadDispatcher.InvokeAsync(delegate
            {
                const string Template = "text <#@<# code #>"; // an error in the middle of the line
                string fileName       = this.CreateTempFile(Path.GetTempPath(), Template);
                using (ITextDocument document = this.documentFactory.CreateAndLoadTextDocument(fileName, this.textContentType))
                {
                    TemplateErrorReporter.GetOrCreate(document.TextBuffer, IntegrationTest.ServiceProvider, this.documentFactory);
                    ErrorItem errorItem = IntegrationTest.ErrorItems.Single(e => e.FileName.Equals(fileName, StringComparison.OrdinalIgnoreCase));
                    errorItem.Navigate();

                    Assert.AreEqual(fileName, Dte.ActiveDocument.FullName);

                    var activeDocument = (TextDocument)Dte.ActiveDocument.Object();
                    Assert.AreEqual(Template.LastIndexOf("<#", System.StringComparison.Ordinal) + 1, activeDocument.Selection.CurrentColumn);
                }
            });
        }
Exemplo n.º 2
0
 public IEnumerable <object> InvokeItem(IContext context, string path)
 {
     _item.Navigate();
     return(null);
 }
Exemplo n.º 3
0
 public void Navigate()
 {
     _item.Navigate();
 }