Skip to content

Commit

Permalink
fix: Fix lock contention in XAML generator during compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 committed Oct 9, 2024
1 parent f68788e commit 640ebba
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ private void InitTelemetry(GeneratorExecutionContext context)
|| _isDesignTimeBuild;

_telemetry = new Telemetry.Telemetry(isTelemetryOptout);

#if DEBUG
Console.WriteLine($"Telemetry enabled: {_telemetry.Enabled}");
#endif
}

private bool IsTelemetryEnabled => _telemetry?.Enabled ?? false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,6 @@ private ResourceDetails[] BuildLocalResourceDetails(CancellationToken ct)
.WithCancellation(ct)
.SelectMany(file =>
{
#if DEBUG
Console.WriteLine("Parse resource file : " + file.Identity);
#endif
try
{
var sourceText = file.File.GetText(ct)!;
Expand Down Expand Up @@ -667,9 +664,6 @@ private ResourceDetails[] BuildLocalResourceDetails(CancellationToken ct)
.Distinct()
.ToArray();

#if DEBUG
Console.WriteLine(resourceKeys.Length + " localization keys found");
#endif
return resourceKeys;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,6 @@ public XamlFileGenerator(

public SourceText GenerateFile()
{
#if DEBUG
Console.WriteLine("Processing file {0} (cs: {1})".InvariantCultureFormat(_fileDefinition.FilePath, _fileDefinition.Checksum));
#endif

try
{
return InnerGenerateFile();
Expand Down Expand Up @@ -4595,9 +4591,6 @@ private string GetCustomMarkupExtensionValue(XamlMemberDefinition member, string

if (declaringType == null || propertyType == null)
{
#if DEBUG
Console.WriteLine($"Unable to determine the target dependency property for the markup extension ('{member.Member}' cannot be found).");
#endif
return string.Empty;
}

Expand Down Expand Up @@ -6732,9 +6725,6 @@ private string GetFloatingPointLiteral(string memberValue, INamedTypeSymbol type
}
else if (memberValue.EndsWith("px", StringComparison.OrdinalIgnoreCase))
{
#if DEBUG
Console.WriteLine($"The value [{memberValue}] is specified in pixel and is not yet supported. ({owner?.LineNumber}, {owner?.LinePosition} in {_fileDefinition.FilePath})");
#endif
return "{0}{1}".InvariantCultureFormat(memberValue.TrimEnd("px"), isDouble ? "d" : "f");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ private static void ScavengeCache()
{
try
{
#if DEBUG
Console.WriteLine("Pre-processing XAML file: {0}", targetFilePath);
#endif

var sourceText = file.GetText(cancellationToken)!;
if (sourceText is null)
{
Expand Down

0 comments on commit 640ebba

Please sign in to comment.