Skip to content

Commit de8332d

Browse files
committed
clean up
1 parent 130b778 commit de8332d

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

Services/SubSonicTemplatingService/SubSonicTemplatingService.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,18 @@ private string TransformationHost_ResolveParameterValueEventHandler(object sende
8282

8383
private string TransformationHost_ExpandAllVariablesEventHandler(object sender, Host.ExpandAllVariablesEventArgs args)
8484
{
85+
#pragma warning disable VSTHRD102 // Implement internal logic asynchronously
8586
return VsShell.ThreadHelper.JoinableTaskFactory.Run(async () =>
87+
#pragma warning restore VSTHRD102 // Implement internal logic asynchronously
8688
await ExpandAllVariablesAsync(args.FilePath)
8789
);
8890
}
8991

9092
private string TransformationHost_ResolveAssemblyReferenceEventHandler(object sender, Host.ResolveAssemblyReferenceEventArgs args)
9193
{
94+
#pragma warning disable VSTHRD102 // Implement internal logic asynchronously
9295
return VsShell.ThreadHelper.JoinableTaskFactory.Run(async () =>
96+
#pragma warning restore VSTHRD102 // Implement internal logic asynchronously
9397
await ResolveAssemblyReferenceAsync(args.AssemblyReference)
9498
);
9599
}

Services/SubSonicTemplatingService/TextTemplating.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,9 @@ private void StartTransformation(string filename, IProcessTransformationRunner r
559559

560560
foreach (var templateError in result.Errors)
561561
{
562-
ThreadHelper.JoinableTaskFactory.RunAsync(async () => await LogErrorAsync(templateError.Message, templateError.Location, templateError.IsWarning));
562+
#pragma warning disable VSTHRD010
563+
ThreadHelper.JoinableTaskFactory.RunAsync(async () => await LogErrorAsync(templateError.Message, templateError.Location, templateError.IsWarning).ConfigureAwait(false));
564+
#pragma warning restore VSTHRD010
563565
}
564566

565567
processOutput = result.TemplateOutput;

SubSonic.Core.VisualStudio.Common/SubSonic.Core.VisualStudio.Host/RemoteTransformationHost.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ public class RemoteTransformationHost
3232
private readonly Dictionary<RuntimeKind, List<string>> referencePaths;
3333
private readonly Dictionary<string, string> parameters;
3434
private readonly Dictionary<string, KeyValuePair<string, string>> directiveProcessors;
35-
36-
private readonly TemplateErrorCollection errors;
3735

3836
[NonSerialized]
3937
private GetHostOptionEventHandler getHostOptionEventHandler;
@@ -117,7 +115,6 @@ public RemoteTransformationHost()
117115
includePaths = new List<string>();
118116
referencePaths = new Dictionary<RuntimeKind, List<string>>();
119117
directiveProcessors = new Dictionary<string, KeyValuePair<string, string>>();
120-
errors = new TemplateErrorCollection();
121118
}
122119

123120
public Dictionary<RuntimeKind, List<string>> ReferencePaths => referencePaths;
@@ -182,9 +179,10 @@ public void AddReferencePath(RuntimeKind runtime, string directoryPath)
182179

183180
public override ITextTemplatingSession CreateSession()
184181
{
185-
ITextTemplatingSession session = new TextTemplatingSession();
186-
187-
session[nameof(TemplateFile)] = TemplateFile;
182+
ITextTemplatingSession session = new TextTemplatingSession
183+
{
184+
[nameof(TemplateFile)] = TemplateFile
185+
};
188186

189187
return session;
190188
}

0 commit comments

Comments
 (0)