Skip to content

Commit 57b85a1

Browse files
committed
Debugger.Launch();
1 parent ecd0252 commit 57b85a1

File tree

1 file changed

+1
-42
lines changed

1 file changed

+1
-42
lines changed

Libraries/src/Amazon.Lambda.Annotations.SourceGenerator/Writers/CloudFormationJsonWriter.cs

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public void ApplyReport(AnnotationReport report)
3939
_jsonWriter.Parse(originalContent);
4040

4141
var processedLambdaFunctions = new HashSet<string>();
42-
var processedQueues = new HashSet<string>();
4342

4443
foreach (var lambdaFunction in report.LambdaFunctions)
4544
{
@@ -49,21 +48,6 @@ public void ApplyReport(AnnotationReport report)
4948
processedLambdaFunctions.Add(lambdaFunction.Name);
5049
}
5150

52-
53-
//foreach (var queueModelSerializable in report.Queues)
54-
//{
55-
// if (!ShouldProcessQueue(queueModelSerializable))
56-
// continue;
57-
// ProcessQueue(queueModelSerializable, relativeProjectUri);
58-
// processedQueues.Add(queueModelSerializable.LogicalId);
59-
60-
//}
61-
62-
RemoveOrphanedLambdaFunctions(processedLambdaFunctions);
63-
RemoveOrphanedQueues(processedQueues);
64-
65-
66-
6751
var json = _jsonWriter.GetPrettyJson();
6852
_fileManager.WriteAllText(report.CloudFormationTemplatePath, json);
6953

@@ -171,6 +155,7 @@ private void ProcessLambdaFunctionEventAttributes(ILambdaFunctionSerializable la
171155
currentSyncedEvents.Add(eventName);
172156
break;
173157
case AttributeModel<SqsMessageAttribute> sqsAttributeModel:
158+
Debugger.Launch();
174159
eventName = ProcessSqsMessageAttribute(lambdaFunction, sqsAttributeModel.Data);
175160
currentSyncedEvents.Add(eventName);
176161
break;
@@ -291,32 +276,6 @@ private void RemoveOrphanedLambdaFunctions(HashSet<string> processedLambdaFuncti
291276
_jsonWriter.RemoveToken($"Resources.{resourceName}");
292277
}
293278
}
294-
private void RemoveOrphanedQueues(HashSet<string> processedQueues)
295-
{
296-
var resourceToken = _jsonWriter.GetToken("Resources") as JObject;
297-
if (resourceToken == null)
298-
return;
299-
300-
var toRemove = new List<string>();
301-
foreach (var resource in resourceToken.Properties())
302-
{
303-
var resourcePath = $"Resources.{resource.Name}";
304-
var type = _jsonWriter.GetToken($"{resourcePath}.Type", string.Empty);
305-
var creationTool = _jsonWriter.GetToken($"{resourcePath}.Metadata.Tool", string.Empty);
306-
307-
if (string.Equals(type.ToObject<string>(), "AWS::SQS::Queue", StringComparison.Ordinal)
308-
&& string.Equals(creationTool.ToObject<string>(), "Amazon.Lambda.Annotations", StringComparison.Ordinal)
309-
&& !processedQueues.Contains(resource.Name))
310-
{
311-
toRemove.Add(resource.Name);
312-
}
313-
}
314-
315-
foreach (var resourceName in toRemove)
316-
{
317-
_jsonWriter.RemoveToken($"Resources.{resourceName}");
318-
}
319-
}
320279

321280
private JToken GetValueOrRef(string value)
322281
{

0 commit comments

Comments
 (0)