Skip to content

Enable Linux execution for issue #83159 Windows-only formatting tests#84415

Draft
mwiemer-microsoft wants to merge 5 commits into
mainfrom
mwiemer-fix-windows-only-formatting-tests
Draft

Enable Linux execution for issue #83159 Windows-only formatting tests#84415
mwiemer-microsoft wants to merge 5 commits into
mainfrom
mwiemer-fix-windows-only-formatting-tests

Conversation

@mwiemer-microsoft

@mwiemer-microsoft mwiemer-microsoft commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

  • switch IDE elastic newline insertions from hardcoded CRLF to Environment.NewLine-backed trivia in code fixes/refactorings
  • remove WindowsOnly attributes for issue Code action fixer is seemingly hard coding windows line endings #83159 tests that are now platform-agnostic
  • keep only the truly CRLF-semantic tests Windows-only, with inline comments explaining why

Validation

  • dotnet build Ide.slnf
  • dotnet build Compilers.slnf

Remaining Windows-only tests

  • ConvertToRawString tests that validate literal \r\n semantics
  • one MakeFieldReadonly theory with InlineData("\r\n") / InlineData("\r\n\r\n")
Microsoft Reviewers: Open in CodeFlow

mwiemer-microsoft and others added 3 commits July 6, 2026 15:36
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace SyntaxFactory.ElasticCarriageReturnLineFeed with
SyntaxFactory.ElasticEndOfLine(Environment.NewLine) in IDE code fixes
and refactorings so inserted trivia uses platform-appropriate newlines.

This allows the ~73 tests marked WindowsOnly (issue #83159) to run on
Linux as well. The remaining 11 tests (10 ConvertToRawString + 1
MakeFieldReadonly Theory) remain WindowsOnly because they test
platform-specific CRLF content in string literals/test data.

Files changed in production code:
- CSharpSyntaxGeneratorInternal.cs
- TypeDeclarationSyntaxExtensions.cs
- CSharpCodeGenerationHelpers.cs
- UseSimpleUsingStatementCodeFixProvider.cs
- CSharpIsAndCastCheckCodeFixProvider.cs
- CSharpUseConditionalExpressionHelpers.cs
- CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs
- ConvertToRecordEngine.cs
- CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs
- CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs
- CSharpIntroduceVariableService_IntroduceLocal.cs
- CSharpMethodExtractor.CSharpCodeGenerator.cs
- DocCommentConverter.cs
- ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs
- UseExpressionBodyForLambdaCodeActionHelpers.cs
- CSharpMetadataAsSourceService.cs

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…t status

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
mwiemer-microsoft and others added 2 commits July 6, 2026 15:46
…aths

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@mwiemer-microsoft

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s), but failed to run 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant