From 517560aa8e3707852a6bc9bc6a80fc06195c70eb Mon Sep 17 00:00:00 2001 From: Mustafa Nesin Date: Mon, 1 Aug 2022 07:40:01 +0300 Subject: [PATCH 1/2] Fix highlighting in docs examples --- docs/csharp/programming-guide/concepts/async/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/csharp/programming-guide/concepts/async/index.md b/docs/csharp/programming-guide/concepts/async/index.md index d38d24a659644..9ebc655f7e3c8 100644 --- a/docs/csharp/programming-guide/concepts/async/index.md +++ b/docs/csharp/programming-guide/concepts/async/index.md @@ -25,7 +25,7 @@ For a parallel algorithm, you'd need multiple cooks (or threads). One would make Now, consider those same instructions written as C# statements: -:::code language="csharp" source="snippets/index/AsyncBreakfast-starter/Program.cs" highlight="8-34"::: +:::code language="csharp" source="snippets/index/AsyncBreakfast-starter/Program.cs" highlight="15-34"::: :::image type="content" source="media/synchronous-breakfast.png" alt-text="synchronous breakfast"::: @@ -247,7 +247,7 @@ while (breakfastTasks.Count > 0) After all those changes, the final version of the code looks like this: -:::code language="csharp" source="snippets/index/AsyncBreakfast-final/Program.cs" highlight="9-40"::: +:::code language="csharp" source="snippets/index/AsyncBreakfast-final/Program.cs" highlight="16-47"::: :::image type="content" source="media/whenany-async-breakfast.png" alt-text="when any async breakfast"::: From f0d9c6c296f41feccb4413c3dabfb47764bb1a65 Mon Sep 17 00:00:00 2001 From: Mustafa Nesin Date: Mon, 1 Aug 2022 07:59:20 +0300 Subject: [PATCH 2/2] Exclude class declarations from SnippetMain --- .../concepts/async/snippets/index/AsyncBreakfast-V2/Program.cs | 2 +- .../concepts/async/snippets/index/AsyncBreakfast-V3/Program.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V2/Program.cs b/docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V2/Program.cs index 5ef08ea14136c..f1e537c70e4e0 100644 --- a/docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V2/Program.cs +++ b/docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V2/Program.cs @@ -5,7 +5,6 @@ namespace AsyncBreakfast { class Program { - // // These classes are intentionally empty for the purpose of this example. They are simply marker classes for the purpose of demonstration, contain no properties, and serve no other purpose. internal class Bacon { } internal class Coffee { } @@ -13,6 +12,7 @@ internal class Egg { } internal class Juice { } internal class Toast { } + // static async Task Main(string[] args) { Coffee cup = PourCoffee(); diff --git a/docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V3/Program.cs b/docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V3/Program.cs index 92cec48ad47aa..7ceab2c2bb491 100644 --- a/docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V3/Program.cs +++ b/docs/csharp/programming-guide/concepts/async/snippets/index/AsyncBreakfast-V3/Program.cs @@ -5,7 +5,6 @@ namespace AsyncBreakfast { class Program { - // // These classes are intentionally empty for the purpose of this example. They are simply marker classes for the purpose of demonstration, contain no properties, and serve no other purpose. internal class Bacon { } internal class Coffee { } @@ -13,6 +12,7 @@ internal class Egg { } internal class Juice { } internal class Toast { } + // static async Task Main(string[] args) { Coffee cup = PourCoffee();