-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #400 from Sergio0694/dev/raw-multiline-toggle
Only emit raw multiline string literals when possible
- Loading branch information
Showing
6 changed files
with
81 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/ComputeSharp.SourceGeneration/Extensions/IncrementalValueProviderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Microsoft.CodeAnalysis; | ||
|
||
namespace ComputeSharp.SourceGeneration.Extensions; | ||
|
||
/// <summary> | ||
/// Extension methods for the <see cref="IncrementalValueProvider{TValue}"/> type. | ||
/// </summary> | ||
internal static class IncrementalValueProviderExtensions | ||
{ | ||
/// <summary> | ||
/// Combines three <see cref="IncrementalValueProvider{TValue}"/> instances. | ||
/// </summary> | ||
/// <typeparam name="T1">The type of values produced by the first <see cref="IncrementalValueProvider{TValue}"/> input.</typeparam> | ||
/// <typeparam name="T2">The type of values produced by the second <see cref="IncrementalValueProvider{TValue}"/> input.</typeparam> | ||
/// <typeparam name="T3">The type of values produced by the third <see cref="IncrementalValueProvider{TValue}"/> input.</typeparam> | ||
/// <param name="source1">The first <see cref="IncrementalValueProvider{TValue}"/> input.</param> | ||
/// <param name="source2">The second <see cref="IncrementalValueProvider{TValue}"/> input.</param> | ||
/// <param name="source3">The third <see cref="IncrementalValueProvider{TValue}"/> input.</param> | ||
/// <returns>The resulting combined <see cref="IncrementalValueProvider{TValue}"/> result.</returns> | ||
public static IncrementalValueProvider<(T1, T2, T3)> Combine<T1, T2, T3>( | ||
this IncrementalValueProvider<T1> source1, | ||
IncrementalValueProvider<T2> source2, | ||
IncrementalValueProvider<T3> source3) | ||
{ | ||
return | ||
source1 | ||
.Combine(source2) | ||
.Combine(source3) | ||
.Select(static (items, _) => (items.Left.Left, items.Left.Right, items.Right)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters