|
3 | 3 | Purpose: Helper source files (embedded) for .NET incremental generators; keep output deterministic and public API stable. |
4 | 4 |
|
5 | 5 | ## 1. Scope |
6 | | -Chat = terse (summary + reason + minimal diff). Repo docs = rich (rationale, examples, edge cases, perf). Additive edits only. |
| 6 | +Chat = terse (summary + reason + minimal sample). Repo docs = rich (rationale, examples, edge cases, perf). Additive = new files/members only; no deletions, renames, or moves unless explicitly requested. |
7 | 7 |
|
8 | 8 | ## 2. Platform & Stability |
9 | 9 | netstandard2.0 / C# 7.3. No newer BCL APIs. Preserve public type & member names. |
10 | 10 |
|
11 | 11 | ## 3. Guards |
12 | | -Each helper file: |
| 12 | +Each helper file can be excluded from the build using a guard. |
| 13 | +Nest or document dependencies using guards, depending on how closely related the helper file is to the dependency. |
| 14 | +Closely related examples: |
13 | 15 | ``` |
14 | | -#if !DATACUTE_EXCLUDE_<UPPERCASENAME> |
| 16 | +#if !DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAYEXTENSIONS // Feature: EquatableImmutableArrayExtensions |
| 17 | +#if !DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAY // Dependency: EquatableImmutableArray |
15 | 18 | // contents |
| 19 | +#endif // !DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAY |
| 20 | +#endif // !DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAYEXTENSIONS |
| 21 | +``` |
| 22 | +Not closely related examples: |
| 23 | +``` |
| 24 | +#if !DATACUTE_EXCLUDE_ATTRIBUTECONTEXTANDDATA // Feature: AttributeContextAndData |
| 25 | +#if DATACUTE_EXCLUDE_TYPECONTEXT |
| 26 | +#error AttributeContextAndData requires TypeContext (remove DATACUTE_EXCLUDE_TYPECONTEXT or also exclude DATACUTE_EXCLUDE_ATTRIBUTECONTEXTANDDATA) |
| 27 | +#endif |
| 28 | +#if DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAY |
| 29 | +#error AttributeContextAndData requires EquatableImmutableArray (remove DATACUTE_EXCLUDE_EQUATABLEIMMUTABLEARRAY or also exclude DATACUTE_EXCLUDE_ATTRIBUTECONTEXTANDDATA) |
16 | 30 | #endif |
| 31 | +// contents |
| 32 | +#endif // !DATACUTE_EXCLUDE_ATTRIBUTECONTEXTANDDATA |
17 | 33 | ``` |
18 | | -Nest or document dependencies. |
19 | 34 |
|
20 | | -## 4. Editing & Diffs |
21 | | -Show only changed lines (≤3 lines context). Fenced blocks for multi‑line examples. Short reason (perf / determinism / clarity / bug fix). No change‑log comments. UK English. |
| 35 | +## 4. Editing & Samples |
| 36 | +Show only example code snippets (no diffs) with ≤3 lines of surrounding context when needed. Fenced blocks for multi‑line examples. Use code samples to illustrate changes; do not use diff syntax in chat. Use language tags: csharp for C# code, xml for XML docs, and text for plain text. Short reason (perf / determinism / clarity / bug fix). Keep commentary in the chat. Code changes must omit commentary. Resulting code must look like it was always written that way. |
| 37 | + |
| 38 | +When showing a change, prefer Before/After paired samples: |
| 39 | +- Before: the minimal original snippet required for context. |
| 40 | +- After: the revised snippet in full. |
| 41 | + |
| 42 | +## 5. Public API Doc Comments |
| 43 | +For every public type or member emit an XML doc summary (no placeholders). Include <param>/<typeparam>/<returns> when present; only add <remarks> if non-trivial behaviour (threading, allocation, ordering, invariants). |
22 | 44 |
|
23 | | -## 5. Documentation |
24 | | -XML doc first sentence = summary; follow with behaviour / perf / pitfalls if useful. READMEs may include: Overview, Why, Key APIs, Examples, Performance, Dependencies, Exclusion Flags, Instrumentation. Document public surface only (internal/private only if cross‑file contract). Chat brevity does not apply to repo docs. |
| 45 | +## 6. Documentation |
| 46 | +UK English. XML doc first sentence = summary; follow with behaviour / perf / pitfalls if useful. READMEs may include: Overview, Why, Key APIs, Examples, Performance, Dependencies, Exclusion Flags, Instrumentation. Document public surface only (internal/private only if cross‑file contract). Chat brevity does not apply to repo docs. |
25 | 47 |
|
26 | | -## 6. Chat Response Format |
27 | | -1. Summary (1–2 lines) 2. Diff (changed lines) OR fenced example 3. Optional next steps (label “Optional”). |
| 48 | +## 7. Chat Response Format |
| 49 | +1. Summary (1–2 lines) |
| 50 | +2. Example code snippet(s) only (no diff format) |
| 51 | +3. Optional next steps (label “Optional”). |
28 | 52 |
|
29 | | -## 7. Assumptions |
30 | | -If unspecified, state one reversible assumption and proceed. |
| 53 | +## 8. Assumptions |
| 54 | +If unspecified, state one reversible assumption in the chat and proceed. |
0 commit comments