Skip to content

Implementing suggested code changes from ticket #2076 - #2077

Merged
RobertvanderHulst merged 1 commit into
mainfrom
copilot/ticket-2076-implement-code-changes
Sep 3, 2026
Merged

Implementing suggested code changes from ticket #2076#2077
RobertvanderHulst merged 1 commit into
mainfrom
copilot/ticket-2076-implement-code-changes

Conversation

Copilot AI commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Pull request created by AI Agent

…er /shared

Co-authored-by: RobertvanderHulst <14240939+RobertvanderHulst@users.noreply.github.com>
@RobertvanderHulst
RobertvanderHulst marked this pull request as ready for review September 3, 2026 07:13
Copilot AI lite review requested due to automatic review settings September 3, 2026 07:13
@RobertvanderHulst
RobertvanderHulst merged commit 807d6fd into main Sep 3, 2026
1 of 4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is narrowly scoped and directly addresses the documented concurrency issue without introducing additional behavioral changes outside the parser state storage.

Pull request overview

This PR updates the X# extensions to Roslyn’s CSharpCommandLineParser so the mutable X# per-parse option state is no longer shared across concurrent compilations when using the process-wide CSharpCommandLineParser.Default singleton (notably under /shared compiler server scenarios).

Changes:

  • Replaced the instance field used for X# per-parse state with a [ThreadStatic] backing field to prevent cross-thread state corruption.
  • Added lazy initialization via a private options property wrapper, keeping existing call sites intact.
File summaries
File Description
src/Compiler/src/Compiler/XSharpCodeAnalysis/CommandLine/XSharpCommandLineParser.cs Makes X# command-line parsing state thread-isolated to avoid concurrency corruption when parsing via CSharpCommandLineParser.Default.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants