本文整理汇总了C#中ParsedDocument.GetTagCommentsAsync方法的典型用法代码示例。如果您正苦于以下问题:C# ParsedDocument.GetTagCommentsAsync方法的具体用法?C# ParsedDocument.GetTagCommentsAsync怎么用?C# ParsedDocument.GetTagCommentsAsync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParsedDocument
的用法示例。
在下文中一共展示了ParsedDocument.GetTagCommentsAsync方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateQuickTasks
async Task UpdateQuickTasks (DocumentContext ctx, ParsedDocument doc, CancellationToken token)
{
if (isDisposed)
return;
var newTasks = ImmutableArray<QuickTask>.Empty.ToBuilder ();
if (doc != null) {
foreach (var cmt in await doc.GetTagCommentsAsync(token).ConfigureAwait (false)) {
if (token.IsCancellationRequested)
return;
int offset;
try {
offset = textEditor.LocationToOffset (cmt.Region.Begin.Line, cmt.Region.Begin.Column);
} catch (Exception) {
return;
}
var newTask = new QuickTask (cmt.Text, offset, DiagnosticSeverity.Info);
newTasks.Add (newTask);
}
foreach (var error in await doc.GetErrorsAsync(token).ConfigureAwait (false)) {
if (token.IsCancellationRequested)
return;
if (ctx.IsAdHocProject && !lexicalError.Contains (error.Id))
continue;
int offset;
try {
offset = textEditor.LocationToOffset (error.Region.Begin.Line, error.Region.Begin.Column);
} catch (Exception) {
return;
}
var newTask = new QuickTask (error.Message, offset, error.ErrorType == MonoDevelop.Ide.TypeSystem.ErrorType.Error ? DiagnosticSeverity.Error : DiagnosticSeverity.Warning);
newTasks.Add (newTask);
}
}
if (token.IsCancellationRequested)
return;
Application.Invoke (delegate {
if (token.IsCancellationRequested || isDisposed)
return;
tasks = newTasks.ToImmutable ();
OnTasksUpdated (EventArgs.Empty);
});
}