Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

CI build failing with CS0103: The name 'SymbolDisplay' does not exist in the current context at line 664 in DecoratorGenerator.cs.

Problem

The code references SymbolDisplay.FormatPrimitive() without qualification. Two SymbolDisplay classes exist:

  • Microsoft.CodeAnalysis.SymbolDisplay (no FormatPrimitive method)
  • Microsoft.CodeAnalysis.CSharp.SymbolDisplay (has FormatPrimitive method)

Despite using Microsoft.CodeAnalysis.CSharp; being present, the compiler cannot resolve the ambiguity.

Changes

Fully qualify the method call in FormatDefaultValue():

// Before
return SymbolDisplay.FormatPrimitive(param.ExplicitDefaultValue, quoteStrings: true, useHexadecimalNumbers: false);

// After
return Microsoft.CodeAnalysis.CSharp.SymbolDisplay.FormatPrimitive(param.ExplicitDefaultValue, quoteStrings: true, useHexadecimalNumbers: false);
Original prompt

This section details on the original issue you should resolve

<issue_title>[BUG] CI Build Failure on Release</issue_title>
<issue_description>## Description
The CI build is failing with a compilation error in DecoratorGenerator.cs at line 663.

Error Details

error CS0103: The name 'SymbolDisplay' does not exist in the current context
[/home/runner/work/PatternKit/PatternKit/src/PatternKit.Generators/PatternKit.Generators.csproj]

Location: src/PatternKit.Generators/DecoratorGenerator.cs(663,16)

Failed Job: https://github.com/JerrettDavis/PatternKit/actions/runs/21299756617/job/61314298472

Commit: 0ec123a

Root Cause

The SymbolDisplay class is being used on line 663, but it appears the project may be missing the appropriate reference to the Roslyn package that provides this class, or there's an issue with the package reference configuration.

Code Reference

// Line 663 in DecoratorGenerator.cs
return SymbolDisplay.FormatPrimitive(param.ExplicitDefaultValue, quoteStrings: true, useHexadecimalNumbers: false);

While using Microsoft.CodeAnalysis; is present at the top of the file, the SymbolDisplay class may not be available in the current compilation context.

Suggested Solution

Verify that the PatternKit.Generators.csproj file includes the appropriate package reference:

<ItemGroup>
  <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" PrivateAssets="all" />
</ItemGroup>

Ensure the version is compatible with the target framework and other dependencies in the project.

Additional Context

  • This is preventing the build from completing successfully
  • The error appeared during the pack step of the CI workflow
  • Three warnings also present but not blocking (CS0436, RS1032)</issue_description>

Comments on the Issue (you are @copilot in this section)

@JerrettDavis @copilot address

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: JerrettDavis <2610199+JerrettDavis@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI build failure due to missing SymbolDisplay reference Fix ambiguous SymbolDisplay reference in DecoratorGenerator Jan 29, 2026
Copilot AI requested a review from JerrettDavis January 29, 2026 05:13
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.

[BUG] CI Build Failure on Release

2 participants