Skip to content

Commit c057f25

Browse files
authored
Merge pull request #68023 from Cosifne/dev/shech/testScoutQueue
Scouting queue to move forward with the code flow
2 parents 12c7d96 + f94a6ca commit c057f25

File tree

21 files changed

+298
-60
lines changed

21 files changed

+298
-60
lines changed

azure-pipelines-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ parameters:
5656
- name: queueName
5757
displayName: Queue Name
5858
type: string
59-
default: windows.vs2022preview.amd64.open
59+
default: windows.vs2022preview.scout.amd64.open
6060
values:
6161
- windows.vs2022.amd64.open
6262
- windows.vs2022.scout.amd64.open

eng/Versions.props

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,23 @@
2525
<MicrosoftVisualStudioExtensibilityTestingVersion>0.1.149-beta</MicrosoftVisualStudioExtensibilityTestingVersion>
2626
<!-- CodeStyleAnalyzerVersion should we updated together with version of dotnet-format in dotnet-tools.json -->
2727
<CodeStyleAnalyzerVersion>4.3.0-1.final</CodeStyleAnalyzerVersion>
28-
<VisualStudioEditorPackagesVersion>17.6.76-preview</VisualStudioEditorPackagesVersion>
28+
<VisualStudioEditorPackagesVersion>17.6.252</VisualStudioEditorPackagesVersion>
2929
<!-- This should generally be set to $(VisualStudioEditorPackagesVersion),
3030
but sometimes EditorFeatures.Cocoa specifically requires a newer editor build. -->
3131
<VisualStudioMacEditorPackagesVersion>$(VisualStudioEditorPackagesVersion)</VisualStudioMacEditorPackagesVersion>
3232
<ILAsmPackageVersion>6.0.0-rtm.21518.12</ILAsmPackageVersion>
3333
<ILDAsmPackageVersion>6.0.0-rtm.21518.12</ILDAsmPackageVersion>
3434
<MicrosoftVisualStudioLanguageServerClientPackagesVersion>17.6.26-preview</MicrosoftVisualStudioLanguageServerClientPackagesVersion>
35-
<MicrosoftVisualStudioLanguageServerProtocolPackagesVersion>17.6.15-preview</MicrosoftVisualStudioLanguageServerProtocolPackagesVersion>
36-
<MicrosoftVisualStudioShellPackagesVersion>17.5.33422.76</MicrosoftVisualStudioShellPackagesVersion>
35+
<MicrosoftVisualStudioLanguageServerProtocolPackagesVersion>17.6.22</MicrosoftVisualStudioLanguageServerProtocolPackagesVersion>
36+
<MicrosoftVisualStudioShellPackagesVersion>17.6.35829</MicrosoftVisualStudioShellPackagesVersion>
3737
<RefOnlyMicrosoftBuildPackagesVersion>16.10.0</RefOnlyMicrosoftBuildPackagesVersion>
3838
<!-- The version of Roslyn we build Source Generators against that are built in this
3939
repository. This must be lower than MicrosoftNetCompilersToolsetVersion,
4040
but not higher than our minimum dogfoodable Visual Studio version, or else
4141
the generators we build would load on the command line but not load in IDEs. -->
4242
<SourceGeneratorMicrosoftCodeAnalysisVersion>4.1.0</SourceGeneratorMicrosoftCodeAnalysisVersion>
4343
<MicrosoftILVerificationVersion>7.0.0-alpha.1.22060.1</MicrosoftILVerificationVersion>
44-
<MicrosoftServiceHubVersion>4.1.3100</MicrosoftServiceHubVersion>
45-
<MicrosoftVisualStudioThreadingPackagesVersion>17.5.21</MicrosoftVisualStudioThreadingPackagesVersion>
44+
<MicrosoftVisualStudioThreadingPackagesVersion>17.6.40</MicrosoftVisualStudioThreadingPackagesVersion>
4645
<MicrosoftTestPlatformVersion>17.4.0-preview-20220707-01</MicrosoftTestPlatformVersion>
4746
</PropertyGroup>
4847
<!--
@@ -114,6 +113,7 @@
114113
<MicrosoftInternalVisualStudioInteropVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftInternalVisualStudioInteropVersion>
115114
<MicrosoftInternalVisualStudioShellFrameworkVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftInternalVisualStudioShellFrameworkVersion>
116115
<MicrosoftmacOSRefVersion>12.3.300-rc.3.83</MicrosoftmacOSRefVersion>
116+
<MicrosoftIORedistVersion>6.0.0</MicrosoftIORedistVersion>
117117
<MicrosoftMetadataVisualizerVersion>1.0.0-beta3.21075.2</MicrosoftMetadataVisualizerVersion>
118118
<MicrosoftNETBuildExtensionsVersion>2.2.101</MicrosoftNETBuildExtensionsVersion>
119119
<MicrosoftNETCorePlatformsVersion>5.0.0</MicrosoftNETCorePlatformsVersion>
@@ -127,8 +127,8 @@
127127
<MicrosoftNetSdkVersion>2.0.0-alpha-20170405-2</MicrosoftNetSdkVersion>
128128
<MicrosoftNuGetBuildTasksVersion>0.1.0</MicrosoftNuGetBuildTasksVersion>
129129
<MicrosoftPortableTargetsVersion>0.1.2-dev</MicrosoftPortableTargetsVersion>
130-
<MicrosoftServiceHubClientVersion>$(MicrosoftServiceHubVersion)</MicrosoftServiceHubClientVersion>
131-
<MicrosoftServiceHubFrameworkVersion>$(MicrosoftServiceHubVersion)</MicrosoftServiceHubFrameworkVersion>
130+
<MicrosoftServiceHubClientVersion>4.2.1009</MicrosoftServiceHubClientVersion>
131+
<MicrosoftServiceHubFrameworkVersion>4.2.100</MicrosoftServiceHubFrameworkVersion>
132132
<MicrosoftSourceLinkToolsVersion>1.1.1-beta-21566-01</MicrosoftSourceLinkToolsVersion>
133133
<MicrosoftTeamFoundationServerClientVersion>16.170.0</MicrosoftTeamFoundationServerClientVersion>
134134
<MicrosoftTestPlatformTranslationLayerVersion>$(MicrosoftTestPlatformVersion)</MicrosoftTestPlatformTranslationLayerVersion>
@@ -137,8 +137,8 @@
137137
<MicrosoftVisualStudioCacheVersion>17.3.26-alpha</MicrosoftVisualStudioCacheVersion>
138138
<MicrosoftVisualStudioCallHierarchyPackageDefinitionsVersion>15.8.27812-alpha</MicrosoftVisualStudioCallHierarchyPackageDefinitionsVersion>
139139
<MicrosoftVisualStudioCodeAnalysisSdkUIVersion>15.8.27812-alpha</MicrosoftVisualStudioCodeAnalysisSdkUIVersion>
140-
<MicrosoftVisualStudioComponentModelHostVersion>17.6.76-preview</MicrosoftVisualStudioComponentModelHostVersion>
141-
<MicrosoftVisualStudioCompositionVersion>16.9.20</MicrosoftVisualStudioCompositionVersion>
140+
<MicrosoftVisualStudioComponentModelHostVersion>17.6.199-preview</MicrosoftVisualStudioComponentModelHostVersion>
141+
<MicrosoftVisualStudioCompositionVersion>17.6.6</MicrosoftVisualStudioCompositionVersion>
142142
<MicrosoftVisualStudioCoreUtilityVersion>$(VisualStudioEditorPackagesVersion)</MicrosoftVisualStudioCoreUtilityVersion>
143143
<MicrosoftVisualStudioDebuggerUIInterfacesVersion>17.4.0-beta.22368.1</MicrosoftVisualStudioDebuggerUIInterfacesVersion>
144144
<MicrosoftVisualStudioDebuggerContractsVersion>17.4.0-beta.22368.1</MicrosoftVisualStudioDebuggerContractsVersion>
@@ -178,14 +178,14 @@
178178
<MicrosoftVisualStudioProgressionCommonVersion>15.8.27812-alpha</MicrosoftVisualStudioProgressionCommonVersion>
179179
<MicrosoftVisualStudioProgressionInterfacesVersion>15.8.27812-alpha</MicrosoftVisualStudioProgressionInterfacesVersion>
180180
<MicrosoftVisualStudioProjectSystemVersion>17.0.77-pre-g62a6cb5699</MicrosoftVisualStudioProjectSystemVersion>
181-
<MicrosoftVisualStudioRemoteControlVersion>16.3.44</MicrosoftVisualStudioRemoteControlVersion>
181+
<MicrosoftVisualStudioRemoteControlVersion>16.3.52</MicrosoftVisualStudioRemoteControlVersion>
182182
<MicrosoftVisualStudioSDKAnalyzersVersion>16.10.10</MicrosoftVisualStudioSDKAnalyzersVersion>
183183
<MicrosoftVisualStudioSearchVersion>17.5.0-preview-2-33111-081</MicrosoftVisualStudioSearchVersion>
184-
<MicrosoftVisualStudioSetupConfigurationInteropVersion>3.0.4492</MicrosoftVisualStudioSetupConfigurationInteropVersion>
184+
<MicrosoftVisualStudioSetupConfigurationInteropVersion>3.6.2080</MicrosoftVisualStudioSetupConfigurationInteropVersion>
185185
<MicrosoftVisualStudioShell150Version>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioShell150Version>
186186
<MicrosoftVisualStudioShellFrameworkVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioShellFrameworkVersion>
187187
<MicrosoftVisualStudioShellDesignVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioShellDesignVersion>
188-
<MicrosoftVisualStudioTelemetryVersion>16.6.18</MicrosoftVisualStudioTelemetryVersion>
188+
<MicrosoftVisualStudioTelemetryVersion>17.6.46</MicrosoftVisualStudioTelemetryVersion>
189189
<MicrosoftVisualStudioTemplateWizardInterfaceVersion>8.0.0.0-alpha</MicrosoftVisualStudioTemplateWizardInterfaceVersion>
190190
<MicrosoftVisualStudioTextDataVersion>$(VisualStudioEditorPackagesVersion)</MicrosoftVisualStudioTextDataVersion>
191191
<MicrosoftVisualStudioTextInternalVersion>$(VisualStudioEditorPackagesVersion)</MicrosoftVisualStudioTextInternalVersion>
@@ -196,7 +196,7 @@
196196
<MicrosoftVisualStudioThreadingAnalyzersVersion>$(MicrosoftVisualStudioThreadingPackagesVersion)</MicrosoftVisualStudioThreadingAnalyzersVersion>
197197
<MicrosoftVisualStudioThreadingVersion>$(MicrosoftVisualStudioThreadingPackagesVersion)</MicrosoftVisualStudioThreadingVersion>
198198
<MicrosoftVisualStudioUtilitiesVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioUtilitiesVersion>
199-
<MicrosoftVisualStudioValidationVersion>17.0.71</MicrosoftVisualStudioValidationVersion>
199+
<MicrosoftVisualStudioValidationVersion>17.6.11</MicrosoftVisualStudioValidationVersion>
200200
<MicrosoftVisualStudioInteractiveWindowVersion>4.0.0</MicrosoftVisualStudioInteractiveWindowVersion>
201201
<MicrosoftVisualStudioVsInteractiveWindowVersion>4.0.0</MicrosoftVisualStudioVsInteractiveWindowVersion>
202202
<MicrosoftVisualStudioWinFormsInterfacesVersion>17.0.0-previews-4-31709-430</MicrosoftVisualStudioWinFormsInterfacesVersion>
@@ -290,8 +290,8 @@
290290
If you bump their versions, you must push your changes to a dev branch in dotnet/roslyn and
291291
create a test insertion in Visual Studio to validate.
292292
-->
293-
<NewtonsoftJsonVersion>13.0.1</NewtonsoftJsonVersion>
294-
<StreamJsonRpcVersion>2.14.24</StreamJsonRpcVersion>
293+
<NewtonsoftJsonVersion>13.0.3</NewtonsoftJsonVersion>
294+
<StreamJsonRpcVersion>2.15.26</StreamJsonRpcVersion>
295295
<!--
296296
When updating the S.C.I or S.R.M version please let the MSBuild team know in advance so they
297297
can update to the same version. Version changes require a VS test insertion for validation.

src/Compilers/CSharp/Test/Semantic/SourceGeneration/GeneratorDriverTests.cs

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,6 +2098,130 @@ class C { }
20982098
});
20992099
}
21002100

2101+
[Fact, WorkItem(61162, "https://github.com/dotnet/roslyn/issues/61162")]
2102+
public void IncrementalGenerator_Collect_SyntaxProvider_01()
2103+
{
2104+
var generator = new IncrementalGeneratorWrapper(new PipelineCallbackGenerator(static ctx =>
2105+
{
2106+
var invokedMethodsProvider = ctx.SyntaxProvider
2107+
.CreateSyntaxProvider(
2108+
static (node, _) => node is InvocationExpressionSyntax,
2109+
static (ctx, ct) => ctx.SemanticModel.GetSymbolInfo(ctx.Node, ct).Symbol?.Name ?? "(method not found)")
2110+
.Collect();
2111+
2112+
ctx.RegisterSourceOutput(invokedMethodsProvider, static (spc, invokedMethods) =>
2113+
{
2114+
spc.AddSource("InvokedMethods.g.cs", string.Join(Environment.NewLine,
2115+
invokedMethods.Select(m => $"// {m}")));
2116+
});
2117+
}));
2118+
2119+
var source = """
2120+
System.Console.WriteLine();
2121+
System.Console.WriteLine();
2122+
System.Console.WriteLine();
2123+
System.Console.WriteLine();
2124+
""";
2125+
var parseOptions = TestOptions.RegularPreview;
2126+
Compilation compilation = CreateCompilation(source, options: TestOptions.DebugExeThrowing, parseOptions: parseOptions);
2127+
2128+
GeneratorDriver driver = CSharpGeneratorDriver.Create(new[] { generator }, parseOptions: parseOptions);
2129+
verify(ref driver, compilation, """
2130+
// WriteLine
2131+
// WriteLine
2132+
// WriteLine
2133+
// WriteLine
2134+
""");
2135+
2136+
replace(ref compilation, parseOptions, """
2137+
System.Console.WriteLine();
2138+
System.Console.WriteLine();
2139+
""");
2140+
verify(ref driver, compilation, """
2141+
// WriteLine
2142+
// WriteLine
2143+
""");
2144+
2145+
replace(ref compilation, parseOptions, "_ = 0;");
2146+
verify(ref driver, compilation, "");
2147+
2148+
static void verify(ref GeneratorDriver driver, Compilation compilation, string generatedContent)
2149+
{
2150+
driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics);
2151+
outputCompilation.VerifyDiagnostics();
2152+
generatorDiagnostics.Verify();
2153+
var generatedTree = driver.GetRunResult().GeneratedTrees.Single();
2154+
AssertEx.EqualOrDiff(generatedContent, generatedTree.ToString());
2155+
}
2156+
2157+
static void replace(ref Compilation compilation, CSharpParseOptions parseOptions, string source)
2158+
{
2159+
compilation = compilation.ReplaceSyntaxTree(compilation.SyntaxTrees.Single(), CSharpSyntaxTree.ParseText(source, parseOptions));
2160+
}
2161+
}
2162+
2163+
[Fact, WorkItem(61162, "https://github.com/dotnet/roslyn/issues/61162")]
2164+
public void IncrementalGenerator_Collect_SyntaxProvider_02()
2165+
{
2166+
var generator = new IncrementalGeneratorWrapper(new PipelineCallbackGenerator(static ctx =>
2167+
{
2168+
var invokedMethodsProvider = ctx.SyntaxProvider
2169+
.CreateSyntaxProvider(
2170+
static (node, _) => node is InvocationExpressionSyntax,
2171+
static (ctx, ct) => ctx.SemanticModel.GetSymbolInfo(ctx.Node, ct).Symbol?.Name ?? "(method not found)")
2172+
.Select((n, _) => n);
2173+
2174+
ctx.RegisterSourceOutput(invokedMethodsProvider, static (spc, invokedMethod) =>
2175+
{
2176+
spc.AddSource(invokedMethod, "// " + invokedMethod);
2177+
});
2178+
}));
2179+
2180+
var source = """
2181+
System.Console.WriteLine();
2182+
System.Console.ReadLine();
2183+
""";
2184+
var parseOptions = TestOptions.RegularPreview;
2185+
Compilation compilation = CreateCompilation(source, options: TestOptions.DebugExeThrowing, parseOptions: parseOptions);
2186+
2187+
GeneratorDriver driver = CSharpGeneratorDriver.Create(new[] { generator }, parseOptions: parseOptions);
2188+
verify(ref driver, compilation, new[]
2189+
{
2190+
"// WriteLine",
2191+
"// ReadLine"
2192+
});
2193+
2194+
replace(ref compilation, parseOptions, """
2195+
System.Console.WriteLine();
2196+
""");
2197+
2198+
verify(ref driver, compilation, new[]
2199+
{
2200+
"// WriteLine"
2201+
});
2202+
2203+
replace(ref compilation, parseOptions, "_ = 0;");
2204+
verify(ref driver, compilation, Array.Empty<string>());
2205+
2206+
static void verify(ref GeneratorDriver driver, Compilation compilation, string[] generatedContent)
2207+
{
2208+
driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics);
2209+
outputCompilation.VerifyDiagnostics();
2210+
generatorDiagnostics.Verify();
2211+
var trees = driver.GetRunResult().GeneratedTrees;
2212+
Assert.Equal(generatedContent.Length, trees.Length);
2213+
for (int i = 0; i < generatedContent.Length; i++)
2214+
{
2215+
AssertEx.EqualOrDiff(generatedContent[i], trees[i].ToString());
2216+
}
2217+
}
2218+
2219+
static void replace(ref Compilation compilation, CSharpParseOptions parseOptions, string source)
2220+
{
2221+
compilation = compilation.ReplaceSyntaxTree(compilation.SyntaxTrees.Single(), CSharpSyntaxTree.ParseText(source, parseOptions));
2222+
}
2223+
}
2224+
21012225
[Fact]
21022226
public void IncrementalGenerator_Register_End_Node_Only_Once_Through_Combines()
21032227
{

src/Compilers/CSharp/Test/Semantic/SourceGeneration/StateTableTests.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,45 @@ public void Batch_Node_Records_InputModified_Step_When_Inputs_Are_Changed()
585585
});
586586
}
587587

588+
[Fact, WorkItem(61162, "https://github.com/dotnet/roslyn/issues/61162")]
589+
public void Batch_Node_Remove_From_Beginning()
590+
{
591+
// [A], [B]
592+
var input = new[] { ("A", EntryState.Added), ("B", EntryState.Added) };
593+
var inputNode = new CallbackNode<string>((_, _) =>
594+
{
595+
// Simulate syntax node.
596+
var builder = NodeStateTable<string>.Empty.ToBuilder(null, false);
597+
foreach (var (value, state) in input)
598+
{
599+
builder.AddEntry(value, state, TimeSpan.Zero, default, state);
600+
}
601+
return builder.ToImmutableAndFree();
602+
});
603+
var dstBuilder = GetBuilder(DriverStateTable.Empty);
604+
var table1 = dstBuilder.GetLatestStateTableForNode(inputNode);
605+
AssertTableEntries(table1, new[] { ("A", EntryState.Added, 0), ("B", EntryState.Added, 0) });
606+
AssertTableEntries(table1.AsCached(), new[] { ("A", EntryState.Cached, 0), ("B", EntryState.Cached, 0) });
607+
608+
// batch => [[A], [B]]
609+
var batchNode = new BatchNode<string>(inputNode);
610+
var table2 = dstBuilder.GetLatestStateTableForNode(batchNode);
611+
AssertTableEntries(table2, new[] { (ImmutableArray.Create("A", "B"), EntryState.Added, 0) });
612+
AssertTableEntries(table2.AsCached(), new[] { (ImmutableArray.Create("A", "B"), EntryState.Cached, 0) });
613+
614+
// [B]
615+
input = new[] { ("B", EntryState.Cached) };
616+
dstBuilder = GetBuilder(dstBuilder.ToImmutable());
617+
table1 = dstBuilder.GetLatestStateTableForNode(inputNode);
618+
AssertTableEntries(table1, new[] { ("B", EntryState.Cached, 0) });
619+
AssertTableEntries(table1.AsCached(), new[] { ("B", EntryState.Cached, 0) });
620+
621+
// batch => [[B]]
622+
table2 = dstBuilder.GetLatestStateTableForNode(batchNode);
623+
AssertTableEntries(table2, new[] { (ImmutableArray.Create("B"), EntryState.Modified, 0) });
624+
AssertTableEntries(table2.AsCached(), new[] { (ImmutableArray.Create("B"), EntryState.Cached, 0) });
625+
}
626+
588627
[Fact]
589628
[WorkItem(54832, "https://github.com/dotnet/roslyn/issues/54832")]
590629
public void Transform_Node_Records_NewInput_OnFirst_Run()

0 commit comments

Comments
 (0)