This site provides a machine-readable index at /llms.txt.

Skip to main content Skip to navigation

ISymbolExtractionService Pennington.Roslyn.Symbols

Extracts symbol metadata and source fragments from the configured Roslyn Solution, keyed by xmldocid.

Methods

ClearCache

#
void ClearCache();

Clears any cached symbol lookups so the next query re-walks the solution.

ExtractCodeFragmentAsync

#
Task<string> ExtractCodeFragmentAsync(string xmlDocId, bool bodyOnly = false, bool includeLeadingTrivia = true);

Returns the source-code fragment for the symbol identified by xmlDocId, optionally limited to the member body and optionally including leading trivia (comments/attributes).

Parameters

xmlDocId string
bodyOnly bool (optional)
includeLeadingTrivia bool (optional)

Returns

Task<string>

ExtractDeclarationSignatureAsync

#
Task<string> ExtractDeclarationSignatureAsync(string xmlDocId);

Returns the declaration signature (no body, no accessor list) for the member identified by xmlDocId. Falls back to the full declaration for symbols that have no separable body.

Parameters

xmlDocId string

Returns

Task<string>

ExtractSymbolsAsync

#
Task<IReadOnlyDictionary<string, SymbolInfo>> ExtractSymbolsAsync(Solution solution);

Walks the solution and returns a map of xmldocid to SymbolInfo for every documented symbol.

Parameters

solution Solution

Returns

Task<IReadOnlyDictionary<string, SymbolInfo>>

FindSymbolAsync

#
Task<SymbolInfo?> FindSymbolAsync(string xmlDocId);

Returns the SymbolInfo for the given xmldocid, or null if no symbol matches.

Parameters

xmlDocId string

Returns

Task<SymbolInfo?>

WarmupAsync

#
Task WarmupAsync(CancellationToken cancellationToken = default);

Triggers the symbol table walk if it has not already run. Safe to call concurrently with real queries — both share one AsyncLazy task.

Parameters

cancellationToken CancellationToken (optional)

Returns

Task

Pennington.Roslyn.Symbols.ISymbolExtractionService

namespace Pennington.Roslyn.Symbols;

/// Extracts symbol metadata and source fragments from the configured Roslyn Solution, keyed by xmldocid.
public interface ISymbolExtractionService
{
    /// Clears any cached symbol lookups so the next query re-walks the solution.
    
void ClearCache();
/// Returns the source-code fragment for the symbol identified by xmlDocId, optionally limited to the member body and optionally including leading trivia (comments/attributes).
Task<string> ExtractCodeFragmentAsync(string xmlDocId, bool bodyOnly = false, bool includeLeadingTrivia = true);
/// Returns the declaration signature (no body, no accessor list) for the member identified by xmlDocId. Falls back to the full declaration for symbols that have no separable body.
Task<string> ExtractDeclarationSignatureAsync(string xmlDocId);
/// Walks the solution and returns a map of xmldocid to SymbolInfo for every documented symbol.
Task<IReadOnlyDictionary<string, SymbolInfo>> ExtractSymbolsAsync(Solution solution);
/// Returns the SymbolInfo for the given xmldocid, or null if no symbol matches.
Task<SymbolInfo?> FindSymbolAsync(string xmlDocId);
/// Triggers the symbol table walk if it has not already run. Safe to call concurrently with real queries — both share one AsyncLazy task.
Task WarmupAsync(CancellationToken cancellationToken = default);
}