Infra, Ops & WorkflowSûr100100/100

Formatting Log (.NET)

Import Razor formatting log zips that the user has already downloaded from Azure DevOps feedback tickets or GitHub issues into FormattingLogTest, validate whether the captured problem still reproduces, and if needed drive a minimal repro plus fix workflow.

ou envoie-le directement à ton agent.

Installer dans ton projet

$ curl -fsSL https://arboristhree.xyz/cli/install-skill.mjs -o /tmp/arboris-install-skill.mjs && node /tmp/arboris-install-skill.mjs formatting-log__dotnet-dotnet__src-roslyn-github-skills-8a801803e140
.NET
dotnet/dotnet
Contenu à copier
---
name: formatting-log
description: Import Razor formatting log zips that the user has already downloaded from Azure DevOps feedback tickets or GitHub issues into FormattingLogTest, validate whether the captured problem still reproduces, and if needed drive a minimal repro plus fix workflow.
metadata:
  origin: .NET
---

# Razor Formatting Log Investigation

Use this skill when:
- investigating a Razor formatting issue from Visual Studio or VS Code feedback
- given an Azure DevOps work item, Developer Community ticket, or GitHub issue that includes a formatting log zip
- asked to import a `Full_*_razor.zip` or `Range_*_razor.zip` archive into the test suite

## Goal

1. Get a local path to the formatting log archive.
2. Import every file from that zip into `src\Razor\src\Razor\test\Microsoft.VisualStudio.LanguageServices.Razor.UnitTests\TestFiles\FormattingLog\<TestName>\`.
3. Add a matching `[Fact]` to `src\Razor\src\Razor\test\Microsoft.VisualStudio.LanguageServices.Razor.UnitTests\Cohost\Formatting\FormattingLogTest.cs`.
4. Run the imported formatting log test.
5. If it passes, report that the issue captured in the logs no longer reproduces.
6. If it fails, keep the imported repro, reduce it to a minimal `DocumentFormattingTest`, and then fix the product code.

## Finding the archive

### Azure DevOps / VS feedback ticket

1. Read the work item and comments with the Azure DevOps tools so you know which attachment to ask for.
2. Do **not** try to download Developer Community or Azure DevOps feedback attachments yourself. The available tooling cannot reliably fetch those private files.
3. Ask the user to download the `Full_*_razor.zip` or `Range_*_razor.zip` attachment locally and give you the absolute zip path.
4. Continue only after the user has provided that local path.

### GitHub issue

1. Read the issue body and comments.
2. Look for uploaded zip attachments or linked archives with the same naming pattern.
3. If the archive is directly downloadable, download it to a temporary folder. Otherwise ask the user to download it and provide a local path.

## Import the logs

Use the helper script in this skill:

```powershell
.\.github\skills\formatting-log\scripts\Import-FormattingLog.ps1 `
  -ZipPath C:\Users\dawengie\Downloads\Range_Index_razor.zip `
  -WorkItemUrl https://dev.azure.com/devdiv/DevDiv/_workitems/edit/2878103 `
  -TestName RanOutOfOriginalLines
```

- `-ZipPath` must be a local file path. For Developer Community and Azure DevOps feedback tickets, ask the user to download the archive first instead of trying to fetch it yourself.
- `-TestName` defaults to a sanitized name derived from the zip filename. Override it when you want a shorter or more descriptive repro name.
- Keep the folder name and the test name identical.
- Use `-Expectation Null` only when the correct outcome is that all edits should be filtered out. Otherwise keep the default `NotNull`.
- The script copies every extracted file into the new test asset folder and appends the matching test method to `src\Razor\src\Razor\test\Microsoft.VisualStudio.LanguageServices.Razor.UnitTests\Cohost\Formatting\FormattingLogTest.cs`.

## Run the imported test

```powershell
dotnet test src\Razor\src\Razor\test\Microsoft.VisualStudio.LanguageServices.Razor.UnitTests\Microsoft.VisualStudio.LanguageServices.Razor.UnitTests.csproj --filter "FullyQualifiedName~FormattingLogTest.<TestName>"
```

Do **not** run `dotnet test` at the repo root.

## Interpreting the result

- **Test passes**: report that the problem captured in the logs no longer reproduces.
- **Test fails**: continue with a minimal repro and product fix.

## When the imported log test fails

1. Commit the imported formatting log assets and `FormattingLogTest.cs` change by themselves.
2. Reduce the failure to a focused repro in `src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\DocumentFormattingTest.cs`.
3. Commit the minimal repro by itself.
4. Fix the product code.
5. Commit the fix by itself.
6. Re-run the imported `FormattingLogTest` plus the focused `DocumentFormattingTest` coverage.

The formatting-log test, the minimal repro, and the fix should stay as separate commits during the investigation.

## Notes

- If the user only gives you a Developer Community or Azure DevOps ticket URL, stop and ask them to download the zip before proceeding.
- `FormattingLogTest` accepts both real range payloads and literal `null` `Range.json` files from full-document logs.
- Imported log zips often contain more files than the test currently consumes. Keep them all in the test asset folder.
- Prefer adding `[WorkItem("...")]` with the originating Azure DevOps or GitHub URL on the imported test.
Colle ce Markdown dans ton agent ou utilise les boutons ci-dessus pour l’écrire dans ton projet.

Ce que fait Formatting Log (.NET)

investigating a Razor formatting issue from Visual Studio or VS Code feedback
given an Azure DevOps work item, Developer Community ticket, or GitHub issue that includes a formatting log zip
asked to import a `Full_*_razor.zip` or `Range_*_razor.zip` archive into the test suite
`-ZipPath` must be a local file path. For Developer Community and Azure DevOps feedback tickets, ask the user to download the archive first instead of trying to fetch it yourself.

Comment utiliser Formatting Log (.NET)

1
Copie le prompt
Un clic copie le prompt packagé (ou l'envoie à ton agent).
2
L'agent installe le skill
Il ajoute le SKILL.md et ses ressources à ton projet.
3
Activation automatique
Le skill s'active dès que le contexte correspond.

Déclencheurs pour Formatting Log (.NET)

Dis simplement à ton agent quelque chose comme :

Applique le skill formatting-log__dotnet-dotnet__src-roslyn-github-skills-8a801803e140 à cette tâche
Utilise formatting-log__dotnet-dotnet__src-roslyn-github-skills-8a801803e140 pour améliorer cette implémentation
Passe en revue ce sujet avec formatting-log__dotnet-dotnet__src-roslyn-github-skills-8a801803e140

Skills liés à Formatting Log (.NET)

Add CLI Command (.NET)
Add or change a dotnet CLI command, subcommand, or option across the relevant CLI projects. USE FOR: adding or changing a dotnet CLI command/subcommand, adding a new Option<T> or Argument<T>, registering a subcommand in the command tree, changing an option's help description or a command's runtime message, wiring a command parser, or updating --help output.
Add Dotnet Aot Command (.NET)
Add, enable, or review a dotnet CLI command or feature in the Native AOT CLI (src/Cli/dotnet-aot) and prove its compatibility. USE FOR: migrating a command or option to AOT, reviewing an AOT migration PR, defining conservative eligibility and managed fallback, changing AotSourceFiles.props or AotDependencies.props, validating AOT/managed parity, NativeAOT-publishing tests, checking binary-size impact, or using the dn harness and separated SDK layout. DO NOT USE FOR: resolving IL trim/AOT analyzer warnings alone (use dotnet-aot-compat), running dotnet.Tests incrementally (use incremental-test), or pure managed CLI work.
Add Net Analyzer (.NET)
Add, port, or change a .NET code analysis rule (CA####) under src/Microsoft.CodeAnalysis.NetAnalyzers. USE FOR: implementing a new CA analyzer and its code fixer, porting a rule or PR from the retired dotnet/roslyn-analyzers repo, allocating a diagnostic ID from DiagnosticCategoryAndIdRanges.txt, choosing RuleLevel/severity/category, wiring resx + xlf strings, recording the rule in AnalyzerReleases.Unshipped.md, regenerating the analyzer documentation/sarif files, and writing MSTest analyzer/code-fix tests with the VerifyCS/VerifyVB harness. DO NOT USE FOR: NETSDK#### MSBuild diagnostics (src/Tasks), CS####/BC#### compiler diagnostics or IDE#### analyzers (dotnet/roslyn), or CONTAINER#### diagnostics (src/Containers).