Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
In debug builds, if a debugger is attached, don't cancel async calls
By switching to None cancellation token, we make it easier to debug and
pause for longer times while inspecting the code generation from within
the IDE, that would otherwise be canceled automatically by VS.
  • Loading branch information
kzu committed Jul 6, 2017
commit 2fdb60a5cd1753fd87cd90856ca65b94cdaae276
7 changes: 6 additions & 1 deletion src/Proxy/Proxy.Generator/ProxyGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public static (string name, SyntaxNode syntax) CreateProxy(ImmutableArray<ITypeS
modifiers: DeclarationModifiers.Partial,
baseType: baseType == null ? null : generator.IdentifierName(baseType.Name),
interfaceTypes: interfaceTypes.Select(x => generator.IdentifierName(x.Name))),
generator.Attribute(nameof(CompilerGeneratedAttribute))
generator.Attribute("CompilerGenerated")
)
)
}));
Expand All @@ -256,6 +256,11 @@ public static (string name, SyntaxNode syntax) CreateProxy(ImmutableArray<ITypeS

public static async Task<Document> ApplyVisitors(Document document, ICodeAnalysisServices services, CancellationToken cancellationToken)
{
#if DEBUG
if (Debugger.IsAttached)
cancellationToken = CancellationToken.None;
#endif

var language = document.Project.Language;
var prepares = services.GetLanguageServices<IDocumentVisitor>(language, DocumentVisitorLayer.Prepare).ToArray();
foreach (var prepare in prepares)
Expand Down