Skip to content

Commit

Permalink
Add comments to IResultSetTracker
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmalinowski committed Sep 23, 2022
1 parent 81407cf commit 77a26f0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Features/Lsif/Generator/ResultSetTracking/IResultSetTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,23 @@ namespace Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.ResultSetTr
/// </summary>
internal interface IResultSetTracker
{
/// <summary>
/// Returns the ID of the <see cref="ResultSet"/> that represents a symbol.
/// </summary>
Id<ResultSet> GetResultSetIdForSymbol(ISymbol symbol);

/// <summary>
/// Returns an ID of a vertex that is linked from a result set. For example, a <see cref="ResultSet"/> has an edge that points to a <see cref="ReferenceResult"/>, and
/// item edges from that <see cref="ReferenceResult"/> are the references for the range. This gives you the ID of the <see cref="ReferenceResult"/> in this case.
/// </summary>
Id<T> GetResultIdForSymbol<T>(ISymbol symbol, string edgeKind, Func<T> vertexCreator) where T : Vertex;

/// <summary>
/// Similar to <see cref="GetResultIdForSymbol{T}(ISymbol, string, Func{T})"/>, but instead of creating the vertex (if needed) and adding an edge, this
/// simply tracks that this method has been called, and it's up to the caller that got a true return value to create and add the vertex themselves. This is handy
/// when the actual identity of the node isn't needed by any other consumers, or the vertex creation is expensive and we don't want it running under the lock that
/// <see cref="GetResultIdForSymbol{T}(ISymbol, string, Func{T})"/> would have to take.
/// </summary>
bool ResultSetNeedsInformationalEdgeAdded(ISymbol symbol, string edgeKind);
}
}

0 comments on commit 77a26f0

Please sign in to comment.