> ## Documentation Index
> Fetch the complete documentation index at: https://ancplua.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Extensions

> Opt-in extensions injected via MSBuild properties.

Extensions are code files injected into your project at build time. Enable them via MSBuild properties.

## Available Extensions

| Property                      | What it does                           |
| ----------------------------- | -------------------------------------- |
| `InjectSourceGenHelpers`      | Roslyn utilities for source generators |
| `InjectFakeLogger`            | Test helpers for `FakeLogCollector`    |
| `InjectStringOrdinalComparer` | Singleton string comparers             |

## Source Generator Helpers

For source generator projects. Injects utilities from [ANcpLua.Roslyn.Utilities](/utilities/overview).

```xml theme={null}
<PropertyGroup>
  <InjectSourceGenHelpers>true</InjectSourceGenHelpers>
</PropertyGroup>
```

<Note>
  Source generators can't reference NuGet packages at design-time. This property
  embeds the utilities as internal source files instead.
</Note>

## FakeLogger Extensions

For test projects. Adds helpers for `FakeLogCollector` from `Microsoft.Extensions.Diagnostics.Testing`.

```xml theme={null}
<PropertyGroup>
  <InjectFakeLogger>true</InjectFakeLogger>
</PropertyGroup>
```

Methods injected:

* `GetFullLoggerText()` - Dump all logs as string
* `WaitForLogAsync()` - Async polling for log entries
* `WaitForLogCountAsync()` - Wait for N matching entries

## String Comparers

Singleton ordinal comparers for allocation-free comparisons.

```xml theme={null}
<PropertyGroup>
  <InjectStringOrdinalComparer>true</InjectStringOrdinalComparer>
</PropertyGroup>
```

Classes injected:

* `StringOrdinalComparer.Instance`
* `StringOrdinalIgnoreCaseComparer.Instance`
