Skip to content

Commit a48c278

Browse files
Merge branch 'main' into fully-remove-dispatcher
2 parents e9b4c2a + 097bb8d commit a48c278

File tree

59 files changed

+575
-590
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+575
-590
lines changed

azure-pipelines-official.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ extends:
286286
dropName: $(VisualStudio.DropName)
287287
dropFolder: 'artifacts\VSSetup\$(_BuildConfig)\Insertion'
288288
accessToken: $(_DevDivDropAccessToken)
289+
dropRetentionDays: 90
289290
continueOnError: true
290291
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))
291292

eng/pipelines/test-integration-job.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ steps:
3737
-build
3838
-pack
3939
-publish
40+
-deploy
4041
/p:BuildDependencyVsix=false
4142
name: Build
4243
displayName: Build
@@ -73,6 +74,15 @@ steps:
7374
artifactType: Container
7475
parallel: true
7576

77+
- powershell: ./eng/scripts/InstallProcDump.ps1
78+
displayName: Install ProcDump
79+
80+
- powershell: ./eng/scripts/StartDumpCollectionForHangingBuilds.ps1
81+
$(ProcDumpPath)procdump.exe artifacts/log/${{ parameters.configuration }}
82+
(Get-Date).AddMinutes(240)
83+
devenv, xunit.console, xunit.console.x86
84+
displayName: Start background dump collection
85+
7686
- script: eng\cibuild.cmd
7787
-configuration ${{ parameters.configuration }}
7888
-msbuildEngine vs
@@ -83,15 +93,20 @@ steps:
8393
displayName: Run Integration Tests
8494
condition: succeeded()
8595

96+
- powershell: ./eng/scripts/FinishDumpCollectionForHangingBuilds.ps1 artifacts/log/${{ parameters.configuration }}
97+
displayName: Finish background dump collection
98+
continueOnError: true
99+
condition: always()
100+
86101
- task: PublishBuildArtifacts@1
87102
displayName: Upload Run tests BinLog
88103
condition: always()
89104
continueOnError: true
90105
inputs:
91-
pathtoPublish: artifacts/log/${{ parameters.configuration }}/Build.binlog
92-
artifactName: $(Agent.Os)_$(Agent.JobName) RunTestsBinLog
93-
artifactType: Container
94-
parallel: true
106+
pathtoPublish: artifacts/log/${{ parameters.configuration }}/Build.binlog
107+
artifactName: $(Agent.Os)_$(Agent.JobName) RunTestsBinLog
108+
artifactType: Container
109+
parallel: true
95110

96111
- task: PublishTestResults@2
97112
displayName: Publish xUnit Test Results
@@ -110,12 +125,13 @@ steps:
110125
ArtifactName: '$(System.JobAttempt)-TestResults $(Build.BuildNumber)'
111126
publishLocation: Container
112127
continueOnError: true
113-
condition: succeededOrFailed()
128+
condition: always()
129+
114130
- task: PublishBuildArtifacts@1
115131
displayName: Publish Logs
116132
inputs:
117133
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\log\${{ parameters.configuration }}'
118134
ArtifactName: '$(System.JobAttempt)-Logs ${{ parameters.configuration }} $(Build.BuildNumber)'
119135
publishLocation: Container
120136
continueOnError: true
121-
condition: succeededOrFailed()
137+
condition: always()

eng/scripts/CreateVSHive.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@ for($i=0; $i -le 3; $i++)
3030
if($success -eq $false){
3131
throw "Failed to create hive"
3232
}
33+
34+
Write-Host "-- VS Info --"
35+
$vsDir = Split-Path -Parent $devenvExePath
36+
$isolationIni = Join-Path $vsDir 'devenv.isolation.ini'
37+
Get-Content $isolationIni | Write-Host
38+
Write-Host "-- /VS Info --"

eng/scripts/featureflag.ps1

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[CmdletBinding(PositionalBinding=$false)]
1+
[CmdletBinding(PositionalBinding = $false)]
22
param(
33
[string]$flag = $null,
44
[switch]$enable,
@@ -9,53 +9,59 @@ param(
99
)
1010

1111
if ($null -eq $flag -or '' -eq $flag) {
12-
throw "Specify a -flag to set"
12+
throw "Specify a -flag to set"
1313
}
1414

1515
if ($flag.EndsWith("\")) {
1616
throw "Provided flag '$flag' ends with '\', which is not valid"
1717
}
1818

19-
$value = 0
19+
if ($set -and $get) {
20+
throw "Use only one of set or get"
21+
}
2022

21-
if ($enable)
22-
{
23-
$value = 1
23+
if (-not ($set -or $get)) {
24+
throw "Specify one of -set or -get"
2425
}
2526

26-
# If the flag contains \ assume that the intention was to provide a full path, otherwise use the default for razor lsp feature flags
27-
if (-not $flag.Contains("\"))
28-
{
29-
$flag = "FeatureFlags\Razor\LSP\" + $flag
27+
if ($set) {
28+
if ($enable -and $disable) {
29+
throw "Use only one of -enable or -disable"
30+
}
31+
32+
if (-not ($enable -or $disable)) {
33+
throw "Specify one of -enable or -disable"
34+
}
3035
}
3136

32-
Write-Host "Attempting to modify '$flag' to '$value'"
37+
$value = 0
3338

39+
if ($enable) {
40+
$value = 1
41+
}
3442

3543
$slashIndex = $flag.LastIndexOf("\")
3644

3745
if ($slashIndex -ge 0) {
38-
$flagBase = $flag.Substring(0, $slashIndex)
39-
$flag = $flag.Substring($slashIndex + 1) #+1 to trim the \
40-
}
41-
42-
if ($set -and $get) {
43-
throw "Use only one of set or get"
46+
$flagBase = $flag.Substring(0, $slashIndex)
47+
$flag = $flag.Substring($slashIndex + 1) #+1 to trim the \
4448
}
4549

46-
if (-not ($set -or $get)) {
47-
throw "Specify one of -set or -get"
50+
if ($flag.IndexOf('.') -ge 0) {
51+
Write-Host "Replacing . in $flag with \"
52+
$flag = $flag.Replace(".", "\")
53+
Write-Host "New value for flag: $flag"
4854
}
4955

50-
if ($set)
56+
if (-not ($flag -like "FeatureFlags*"))
5157
{
52-
if ($enable -and $disable) {
53-
throw "Use only one of -enable or -disable"
54-
}
58+
Write-Host "FeatureFlags was not present, modifying $flag"
59+
$flag = "FeatureFlags\" + $flag
60+
Write-Host "New value for flag: $flag"
61+
}
5562

56-
if (-not ($enable -or $disable)) {
57-
throw "Specify one of -enable or -disable"
58-
}
63+
if ($set) {
64+
Write-Host "Attempting to modify '$flag' to '$value'"
5965
}
6066

6167
$engPath = Join-Path $PSScriptRoot ".."
@@ -74,9 +80,10 @@ Write-Host "Running VsRegEdit"
7480
$vsDir = $vsInfo.installationPath.TrimEnd("\")
7581
$vsRegEdit = Join-Path (Join-Path (Join-Path $vsDir 'Common7') 'IDE') 'VsRegEdit.exe'
7682

83+
Write-Host "Current value:"
84+
&$vsRegEdit read "$vsDir" $hive HKCU $flag VALUE dword
85+
7786
if ($set) {
87+
Write-Host "Running $vsRegEdit set `"$vsDir`" $hive HKCU $flag VALUE dword $value"
7888
&$vsRegEdit set "$vsDir" $hive HKCU $flag VALUE dword $value
7989
}
80-
else {
81-
&$vsRegEdit read "$vsDir" $hive HKCU $flag VALUE dword
82-
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the MIT license. See License.txt in the project root for license information.
3+
4+
using System;
5+
using Microsoft.CodeAnalysis.Razor.Logging;
6+
7+
namespace Microsoft.AspNetCore.Razor.Logging;
8+
9+
internal sealed partial class EmptyLoggingFactory
10+
{
11+
private sealed class EmptyLogger : ILogger
12+
{
13+
public static readonly EmptyLogger Instance = new();
14+
15+
private EmptyLogger()
16+
{
17+
}
18+
19+
public bool IsEnabled(LogLevel logLevel) => false;
20+
21+
public void Log(LogLevel logLevel, string message, Exception? exception)
22+
{
23+
}
24+
}
25+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the MIT license. See License.txt in the project root for license information.
3+
4+
using System;
5+
using Microsoft.CodeAnalysis.Razor.Logging;
6+
7+
namespace Microsoft.AspNetCore.Razor.Logging;
8+
9+
internal sealed partial class EmptyLoggingFactory : ILoggerFactory
10+
{
11+
public static readonly EmptyLoggingFactory Instance = new();
12+
13+
private EmptyLoggingFactory()
14+
{
15+
}
16+
17+
public void AddLoggerProvider(ILoggerProvider provider)
18+
=> throw new NotImplementedException();
19+
20+
public ILogger GetOrCreateLogger(string categoryName)
21+
=> EmptyLogger.Instance;
22+
}

src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/ProjectSystem/ProjectSnapshotManagerBenchmarkBase.TestErrorReporter.cs

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/ProjectSystem/ProjectSnapshotManagerBenchmarkBase.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
using System.Collections.Immutable;
66
using System.IO;
77
using Microsoft.AspNetCore.Razor.Language;
8+
using Microsoft.AspNetCore.Razor.Logging;
89
using Microsoft.AspNetCore.Razor.PooledObjects;
910
using Microsoft.CodeAnalysis;
10-
using Microsoft.CodeAnalysis.Razor;
11-
using Microsoft.CodeAnalysis.Razor.Logging;
1211
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
1312
using Microsoft.CodeAnalysis.Text;
14-
using Moq;
1513

1614
namespace Microsoft.AspNetCore.Razor.Microbenchmarks;
1715

@@ -21,7 +19,6 @@ public abstract partial class ProjectSnapshotManagerBenchmarkBase
2119
internal ImmutableArray<HostDocument> Documents { get; }
2220
internal ImmutableArray<TextLoader> TextLoaders { get; }
2321
protected string RepoRoot { get; }
24-
private protected IErrorReporter ErrorReporter { get; }
2522

2623
protected ProjectSnapshotManagerBenchmarkBase(int documentCount = 100)
2724
{
@@ -59,19 +56,12 @@ protected ProjectSnapshotManagerBenchmarkBase(int documentCount = 100)
5956
}
6057

6158
Documents = documents.ToImmutable();
62-
63-
var loggerFactoryMock = new Mock<ILoggerFactory>(MockBehavior.Strict);
64-
loggerFactoryMock
65-
.Setup(x => x.GetOrCreateLogger(It.IsAny<string>()))
66-
.Returns(Mock.Of<ILogger>(MockBehavior.Strict));
67-
68-
ErrorReporter = new TestErrorReporter();
6959
}
7060

7161
internal ProjectSnapshotManager CreateProjectSnapshotManager()
7262
{
7363
return new ProjectSnapshotManager(
7464
projectEngineFactoryProvider: StaticProjectEngineFactoryProvider.Instance,
75-
errorReporter: ErrorReporter);
65+
loggerFactory: EmptyLoggingFactory.Instance);
7666
}
7767
}

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LanguageServerErrorReporter.cs

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ protected override ILspServices ConstructLspServices()
105105
// Add the logger as a service in case anything in CLaSP pulls it out to do logging
106106
services.AddSingleton<ILspLogger>(_logger);
107107

108-
services.AddSingleton<IErrorReporter, LanguageServerErrorReporter>();
109-
110108
services.AddSingleton<IAdhocWorkspaceFactory, AdhocWorkspaceFactory>();
111109
services.AddSingleton<IWorkspaceProvider, LspWorkspaceProvider>();
112110

0 commit comments

Comments
 (0)