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

Skip to main content Skip to navigation

RoslynCodeBlockPreprocessor Pennington.Roslyn.Preprocessing

Preprocesses code blocks with :xmldocid, :path, and :xmldocid-diff modifiers.

Properties

Priority int
Priority — higher runs first.

Constructors

.ctor

#
public RoslynCodeBlockPreprocessor(
    ISymbolExtractionService symbolService,
    SyntaxHighlighter highlighter,
    HighlightingService highlightingService,
    RoslynOptions options,
    IHttpContextAccessor httpContextAccessor);

Creates a new preprocessor wired to the symbol extraction service, Roslyn highlighter, shared highlighting service, options, and per-request diagnostics accessor.

Parameters

symbolService ISymbolExtractionService
highlighter SyntaxHighlighter
highlightingService HighlightingService
options RoslynOptions
httpContextAccessor IHttpContextAccessor

Methods

TryProcess

#
public CodeBlockPreprocessResult? TryProcess(string code, string languageId);

Attempts to preprocess a code block. Returns a result if handled, or null to pass through.

Parameters

code string
languageId string

Returns

CodeBlockPreprocessResult?

Pennington.Roslyn.Preprocessing.RoslynCodeBlockPreprocessor

namespace Pennington.Roslyn.Preprocessing;

/// Preprocesses code blocks with :xmldocid, :path, and :xmldocid-diff modifiers.
public class RoslynCodeBlockPreprocessor
{
    /// Creates a new preprocessor wired to the symbol extraction service, Roslyn highlighter, shared highlighting service, options, and per-request diagnostics accessor.
    
public RoslynCodeBlockPreprocessor(
    ISymbolExtractionService symbolService,
    SyntaxHighlighter highlighter,
    HighlightingService highlightingService,
    RoslynOptions options,
    IHttpContextAccessor httpContextAccessor);
/// Priority — higher runs first.
public int Priority => 100;
/// Attempts to preprocess a code block. Returns a result if handled, or null to pass through.
public CodeBlockPreprocessResult? TryProcess(string code, string languageId);
}