提交 22e68c4d 编写于 作者: C CyrusNajmabadi

Improve diff.

上级 b7b66385
......@@ -6,43 +6,47 @@
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Text;
namespace Microsoft.CodeAnalysis.DocumentHighlighting
{
internal enum HighlightSpanKind
{
None,
Definition,
Reference,
WrittenReference,
}
internal struct HighlightSpan
{
public TextSpan TextSpan { get; }
public HighlightSpanKind Kind { get; }
public HighlightSpan(TextSpan textSpan, HighlightSpanKind kind) : this()
{
this.TextSpan = textSpan;
this.Kind = kind;
}
}
internal struct DocumentHighlights
{
public Document Document { get; }
public ImmutableArray<HighlightSpan> HighlightSpans { get; }
public DocumentHighlights(Document document, ImmutableArray<HighlightSpan> highlightSpans)
{
this.Document = document;
this.HighlightSpans = highlightSpans;
}
}
internal interface IDocumentHighlightsService : ILanguageService
{
Task<ImmutableArray<DocumentHighlights>> GetDocumentHighlightsAsync(
Document document, int position, IImmutableSet<Document> documentsToSearch, CancellationToken cancellationToken);
}
}
namespace Microsoft.CodeAnalysis.DocumentHighlighting
{
internal enum HighlightSpanKind
{
None,
Definition,
Reference,
WrittenReference,
}
internal struct HighlightSpan
{
public TextSpan TextSpan { get; }
public HighlightSpanKind Kind { get; }
public HighlightSpan(TextSpan textSpan, HighlightSpanKind kind) : this()
{
this.TextSpan = textSpan;
this.Kind = kind;
}
}
internal struct DocumentHighlights
{
public Document Document { get; }
public ImmutableArray<HighlightSpan> HighlightSpans { get; }
public DocumentHighlights(Document document, ImmutableArray<HighlightSpan> highlightSpans)
{
this.Document = document;
this.HighlightSpans = highlightSpans;
}
}
/// <summary>
/// Note: This is the new version of the language service and superceded the same named type
/// in the EditorFeatures layer.
/// </summary>
internal interface IDocumentHighlightsService : ILanguageService
{
Task<ImmutableArray<DocumentHighlights>> GetDocumentHighlightsAsync(
Document document, int position, IImmutableSet<Document> documentsToSearch, CancellationToken cancellationToken);
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册