< Summary

Information
Class: NexusLabs.Needlr.Copilot.WebSearchCitation
Assembly: NexusLabs.Needlr.Copilot
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Copilot/WebSearchCitation.cs
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 47
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Title()100%11100%
get_Url()100%11100%
get_StartIndex()100%11100%
get_EndIndex()100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Copilot/WebSearchCitation.cs

#LineLine coverage
 1namespace NexusLabs.Needlr.Copilot;
 2
 3/// <summary>
 4/// Represents a citation from a Copilot web search result, linking a
 5/// span of the answer text to a source URL.
 6/// </summary>
 7/// <remarks>
 8/// <see cref="StartIndex"/> and <see cref="EndIndex"/> are character offsets
 9/// into <see cref="WebSearchResult.Text"/> exactly as returned by the API.
 10/// They correspond to the <c>【3:N†source】</c> markers in the raw text.
 11/// </remarks>
 12public sealed class WebSearchCitation
 13{
 814    internal WebSearchCitation(
 815        string title,
 816        string url,
 817        int startIndex,
 818        int endIndex)
 19    {
 820        Title = title;
 821        Url = url;
 822        StartIndex = startIndex;
 823        EndIndex = endIndex;
 824    }
 25
 26    /// <summary>
 27    /// The title of the cited source page.
 28    /// </summary>
 629    public string Title { get; }
 30
 31    /// <summary>
 32    /// The URL of the cited source.
 33    /// </summary>
 134    public string Url { get; }
 35
 36    /// <summary>
 37    /// The start character offset (inclusive) in
 38    /// <see cref="WebSearchResult.Text"/> where this citation marker appears.
 39    /// </summary>
 340    public int StartIndex { get; }
 41
 42    /// <summary>
 43    /// The end character offset (exclusive) in
 44    /// <see cref="WebSearchResult.Text"/> where this citation marker ends.
 45    /// </summary>
 246    public int EndIndex { get; }
 47}