зеркало из https://github.com/dotnet/razor.git
Merge branch 'main' of github.com:dotnet/razor-tooling into RoslynUpgrade
This commit is contained in:
Коммит
620d9ee0fe
|
@ -1,25 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Dependencies>
|
||||
<ProductDependencies>
|
||||
<Dependency Name="Microsoft.AspNetCore.Razor.Symbols.Transport" Version="7.0.0-preview.5.22471.1">
|
||||
<Dependency Name="Microsoft.AspNetCore.Razor.Symbols.Transport" Version="7.0.0-preview.5.22528.1">
|
||||
<Uri>https://github.com/dotnet/razor-compiler</Uri>
|
||||
<Sha>883416c9d9ec221a9d73e62de093a43f2e2daf90</Sha>
|
||||
<Sha>0d427c7a238c5b7b114802459db7fc56bea6357d</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.CodeAnalysis.Razor.Tooling.Internal" Version="7.0.0-preview.5.22471.1">
|
||||
<Dependency Name="Microsoft.CodeAnalysis.Razor.Tooling.Internal" Version="7.0.0-preview.5.22528.1">
|
||||
<Uri>https://github.com/dotnet/razor-compiler</Uri>
|
||||
<Sha>883416c9d9ec221a9d73e62de093a43f2e2daf90</Sha>
|
||||
<Sha>0d427c7a238c5b7b114802459db7fc56bea6357d</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal" Version="7.0.0-preview.5.22471.1">
|
||||
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal" Version="7.0.0-preview.5.22528.1">
|
||||
<Uri>https://github.com/dotnet/razor-compiler</Uri>
|
||||
<Sha>883416c9d9ec221a9d73e62de093a43f2e2daf90</Sha>
|
||||
<Sha>0d427c7a238c5b7b114802459db7fc56bea6357d</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X.Internal.Transport" Version="7.0.0-preview.5.22471.1">
|
||||
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X.Internal.Transport" Version="7.0.0-preview.5.22528.1">
|
||||
<Uri>https://github.com/dotnet/razor-compiler</Uri>
|
||||
<Sha>883416c9d9ec221a9d73e62de093a43f2e2daf90</Sha>
|
||||
<Sha>0d427c7a238c5b7b114802459db7fc56bea6357d</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.Internal.Transport" Version="7.0.0-preview.5.22471.1">
|
||||
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.Internal.Transport" Version="7.0.0-preview.5.22528.1">
|
||||
<Uri>https://github.com/dotnet/razor-compiler</Uri>
|
||||
<Sha>883416c9d9ec221a9d73e62de093a43f2e2daf90</Sha>
|
||||
<Sha>0d427c7a238c5b7b114802459db7fc56bea6357d</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="6.0.2-servicing.22064.6">
|
||||
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
|
||||
|
@ -32,9 +32,9 @@
|
|||
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
|
||||
<Sha>3a25a7f1cc446b60678ed25c9d829420d6321eba</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.22520.1">
|
||||
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.22524.5">
|
||||
<Uri>https://github.com/dotnet/arcade</Uri>
|
||||
<Sha>7e27c0ab0fc92ec636c26442fd1663dc5714aa4b</Sha>
|
||||
<Sha>c5dd6a1da2e6d9b3423ab809fcda8af2927a408b</Sha>
|
||||
</Dependency>
|
||||
</ToolsetDependencies>
|
||||
</Dependencies>
|
||||
|
|
|
@ -54,11 +54,11 @@
|
|||
-->
|
||||
<!-- TODO: https://github.com/dotnet/razor-tooling/issues/6760 -->
|
||||
<PropertyGroup Label="Automated">
|
||||
<MicrosoftCodeAnalysisRazorToolingInternalPackageVersion>7.0.0-preview.5.22471.1</MicrosoftCodeAnalysisRazorToolingInternalPackageVersion>
|
||||
<MicrosoftAspNetCoreRazorSymbolsTransportPackageVersion>7.0.0-preview.5.22471.1</MicrosoftAspNetCoreRazorSymbolsTransportPackageVersion>
|
||||
<MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>7.0.0-preview.5.22471.1</MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>
|
||||
<MicrosoftAspNetCoreMvcRazorExtensionsVersion1_XInternalTransportPackageVersion>7.0.0-preview.5.22471.1</MicrosoftAspNetCoreMvcRazorExtensionsVersion1_XInternalTransportPackageVersion>
|
||||
<MicrosoftAspNetCoreMvcRazorExtensionsVersion2_XInternalTransportPackageVersion>7.0.0-preview.5.22471.1</MicrosoftAspNetCoreMvcRazorExtensionsVersion2_XInternalTransportPackageVersion>
|
||||
<MicrosoftCodeAnalysisRazorToolingInternalPackageVersion>7.0.0-preview.5.22528.1</MicrosoftCodeAnalysisRazorToolingInternalPackageVersion>
|
||||
<MicrosoftAspNetCoreRazorSymbolsTransportPackageVersion>7.0.0-preview.5.22528.1</MicrosoftAspNetCoreRazorSymbolsTransportPackageVersion>
|
||||
<MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>7.0.0-preview.5.22528.1</MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>
|
||||
<MicrosoftAspNetCoreMvcRazorExtensionsVersion1_XInternalTransportPackageVersion>7.0.0-preview.5.22528.1</MicrosoftAspNetCoreMvcRazorExtensionsVersion1_XInternalTransportPackageVersion>
|
||||
<MicrosoftAspNetCoreMvcRazorExtensionsVersion2_XInternalTransportPackageVersion>7.0.0-preview.5.22528.1</MicrosoftAspNetCoreMvcRazorExtensionsVersion2_XInternalTransportPackageVersion>
|
||||
<MicrosoftNETCoreBrowserDebugHostTransportPackageVersion>6.0.2-servicing.22064.6</MicrosoftNETCoreBrowserDebugHostTransportPackageVersion>
|
||||
<MicrosoftNETCorePlatformsPackageVersion>6.0.1</MicrosoftNETCorePlatformsPackageVersion>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -31,6 +31,17 @@ jobs:
|
|||
|
||||
displayName: OneLocBuild${{ parameters.JobNameSuffix }}
|
||||
|
||||
variables:
|
||||
- group: OneLocBuildVariables # Contains the CeapexPat and GithubPat
|
||||
- name: _GenerateLocProjectArguments
|
||||
value: -SourcesDirectory ${{ parameters.SourcesDirectory }}
|
||||
-LanguageSet "${{ parameters.LanguageSet }}"
|
||||
-CreateNeutralXlfs
|
||||
- ${{ if eq(parameters.UseCheckedInLocProjectJson, 'true') }}:
|
||||
- name: _GenerateLocProjectArguments
|
||||
value: ${{ variables._GenerateLocProjectArguments }} -UseCheckedInLocProjectJson
|
||||
- template: /eng/common/templates/variables/pool-providers.yml
|
||||
|
||||
${{ if ne(parameters.pool, '') }}:
|
||||
pool: ${{ parameters.pool }}
|
||||
${{ if eq(parameters.pool, '') }}:
|
||||
|
@ -41,20 +52,9 @@ jobs:
|
|||
demands: Cmd
|
||||
# If it's not devdiv, it's dnceng
|
||||
${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
|
||||
name: NetCore1ESPool-Internal
|
||||
name: $(DncEngInternalBuildPool)
|
||||
demands: ImageOverride -equals windows.vs2019.amd64
|
||||
|
||||
variables:
|
||||
- group: OneLocBuildVariables # Contains the CeapexPat and GithubPat
|
||||
- name: _GenerateLocProjectArguments
|
||||
value: -SourcesDirectory ${{ parameters.SourcesDirectory }}
|
||||
-LanguageSet "${{ parameters.LanguageSet }}"
|
||||
-CreateNeutralXlfs
|
||||
- ${{ if eq(parameters.UseCheckedInLocProjectJson, 'true') }}:
|
||||
- name: _GenerateLocProjectArguments
|
||||
value: ${{ variables._GenerateLocProjectArguments }} -UseCheckedInLocProjectJson
|
||||
|
||||
|
||||
steps:
|
||||
- task: Powershell@2
|
||||
inputs:
|
||||
|
|
|
@ -40,9 +40,8 @@ jobs:
|
|||
${{ else }}:
|
||||
displayName: Publish to Build Asset Registry
|
||||
|
||||
pool: ${{ parameters.pool }}
|
||||
|
||||
variables:
|
||||
- template: /eng/common/templates/variables/pool-providers.yml
|
||||
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- group: Publish-Build-Assets
|
||||
- group: AzureDevOps-Artifact-Feeds-Pats
|
||||
|
@ -51,6 +50,16 @@ jobs:
|
|||
- ${{ if eq(parameters.publishAssetsImmediately, 'true') }}:
|
||||
- template: /eng/common/templates/post-build/common-variables.yml
|
||||
|
||||
pool:
|
||||
# We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com)
|
||||
${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
|
||||
name: VSEngSS-MicroBuild2022-1ES
|
||||
demands: Cmd
|
||||
# If it's not devdiv, it's dnceng
|
||||
${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
|
||||
name: $(DncEngInternalBuildPool)
|
||||
demands: ImageOverride -equals windows.vs2019.amd64
|
||||
|
||||
steps:
|
||||
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
|
|
|
@ -34,8 +34,6 @@ parameters:
|
|||
jobs:
|
||||
- job: ${{ parameters.jobNamePrefix }}_${{ parameters.platform.name }}
|
||||
displayName: Source-Build (${{ parameters.platform.name }})
|
||||
variables:
|
||||
- template: /eng/common/templates/variables/pool-providers.yml
|
||||
|
||||
${{ each property in parameters.platform.jobProperties }}:
|
||||
${{ property.key }}: ${{ property.value }}
|
||||
|
@ -46,13 +44,24 @@ jobs:
|
|||
${{ if eq(parameters.platform.pool, '') }}:
|
||||
# The default VM host AzDO pool. This should be capable of running Docker containers: almost all
|
||||
# source-build builds run in Docker, including the default managed platform.
|
||||
# /eng/common/templates/variables/pool-providers.yml can't be used here (some customers declare variables already), so duplicate its logic
|
||||
pool:
|
||||
${{ if eq(variables['System.TeamProject'], 'public') }}:
|
||||
name: $(DncEngPublicBuildPool)
|
||||
# Main environments
|
||||
${{ if and(eq(variables['System.TeamProject'], 'public'), ne(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), true)) }}:
|
||||
name: NetCore-Public
|
||||
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open
|
||||
${{ if eq(variables['System.TeamProject'], 'internal') }}:
|
||||
name: $(DncEngInternalBuildPool)
|
||||
${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), true)) }}:
|
||||
name: NetCore1ESPool-Internal
|
||||
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64
|
||||
|
||||
# Servicing build environments
|
||||
${{ if and(eq(variables['System.TeamProject'], 'public'), contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release')) }}:
|
||||
name: NetCore-Svc-Public
|
||||
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open
|
||||
${{ if and(eq(variables['System.TeamProject'], 'internal'), contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release')) }}:
|
||||
name: NetCore1ESPool-Svc-Internal
|
||||
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64
|
||||
|
||||
${{ if ne(parameters.platform.pool, '') }}:
|
||||
pool: ${{ parameters.platform.pool }}
|
||||
|
||||
|
|
|
@ -417,12 +417,11 @@ function MSBuild {
|
|||
Write-PipelineSetVariable -name "NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS" -value "20"
|
||||
Write-PipelineSetVariable -name "NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS" -value "20"
|
||||
|
||||
export NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY=true
|
||||
export NUGET_EXPERIMENTAL_MAX_NETWORK_TRY_COUNT=6
|
||||
export NUGET_EXPERIMENTAL_NETWORK_RETRY_DELAY_MILLISECONDS=1000
|
||||
Write-PipelineSetVariable -name "NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY" -value "true"
|
||||
Write-PipelineSetVariable -name "NUGET_EXPERIMENTAL_MAX_NETWORK_TRY_COUNT" -value "6"
|
||||
Write-PipelineSetVariable -name "NUGET_EXPERIMENTAL_NETWORK_RETRY_DELAY_MILLISECONDS" -value "1000"
|
||||
# https://github.com/dotnet/arcade/issues/11369 - disable new MSBuild server feature on linux
|
||||
# This feature is new and can result in build failures from connection timeout errors.
|
||||
export DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1
|
||||
Write-PipelineSetVariable -name "DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER" -value "1"
|
||||
|
||||
fi
|
||||
|
||||
local toolset_dir="${_InitializeToolset%/*}"
|
||||
|
|
|
@ -16,15 +16,10 @@ steps:
|
|||
versionSpec: 10.x
|
||||
|
||||
# We explicitly pass the VS install directory in azure-pipelines-integration-dartlab.yml
|
||||
- powershell: |
|
||||
& "C:\\Test\\VisualStudio\\Common7\\IDE\\devenv.exe" /rootsuffix RoslynDev /updateConfiguration
|
||||
if(Test-Path -Path $env:LocalAppData\Microsoft\VisualStudio\17.0*RoslynDev)
|
||||
{
|
||||
Write-Host "The hive 'RoslynDev' exists"
|
||||
}
|
||||
else{
|
||||
throw "Failed to create hive"
|
||||
}
|
||||
# We manually create the Hive before deployment to avoid a race condition
|
||||
- powershell: eng\scripts\CreateVSHive.ps1
|
||||
-rootSuffix RoslynDev
|
||||
-devenvExepath C:\\Test\\VisualStudio\\Common7\\IDE\\devenv.exe
|
||||
displayName: Create and Verify hive
|
||||
|
||||
- script: eng\cibuild.cmd
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
#requires -version 5
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]
|
||||
$rootSuffix,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]
|
||||
$devenvExePath
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Set-StrictMode -Version 1
|
||||
|
||||
$success=$false
|
||||
for($i=0; $i -le 3; $i++)
|
||||
{
|
||||
& $devenvExePath /rootsuffix $rootSuffix /updateConfiguration
|
||||
if(Test-Path -Path $env:LocalAppData\Microsoft\VisualStudio\17.0*RoslynDev)
|
||||
{
|
||||
Write-Host "The hive 'RoslynDev' exists"
|
||||
$success=$true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if($success -eq $false){
|
||||
throw "Failed to create hive"
|
||||
}
|
|
@ -21,7 +21,7 @@
|
|||
"rollForward": "latestPatch"
|
||||
},
|
||||
"msbuild-sdks": {
|
||||
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22520.1",
|
||||
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22524.5",
|
||||
"Yarn.MSBuild": "1.22.10"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,6 +98,11 @@ namespace Microsoft.CodeAnalysis.Razor
|
|||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_disposed = true;
|
||||
|
||||
foreach (var update in Updates)
|
||||
|
@ -109,6 +114,10 @@ namespace Microsoft.CodeAnalysis.Razor
|
|||
}
|
||||
}
|
||||
|
||||
// Release before dispose to ensure we don't throw exceptions from the background thread trying to release
|
||||
// while we're disposing. Multiple releases are fine, and if we release and it lets something passed the lock
|
||||
// our cancellation token check will mean its a no-op.
|
||||
_semaphore.Release();
|
||||
_semaphore.Dispose();
|
||||
|
||||
BlockBackgroundWorkStart?.Set();
|
||||
|
@ -122,7 +131,7 @@ namespace Microsoft.CodeAnalysis.Razor
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
// Only allow a single TagHelper resolver request to process at a time in order to reduce Visual Studio memory pressure. Typically a TagHelper resolution result can be upwards of 10mb+.
|
||||
|
@ -215,7 +224,12 @@ namespace Microsoft.CodeAnalysis.Razor
|
|||
{
|
||||
try
|
||||
{
|
||||
_semaphore.Release();
|
||||
// Prevent ObjectDisposedException if we've disposed before we got here. The dispose method will release
|
||||
// anyway, so we're all good.
|
||||
if (!_disposed)
|
||||
{
|
||||
_semaphore.Release();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
|
@ -19,11 +17,11 @@ namespace Microsoft.CodeAnalysis.Razor
|
|||
{
|
||||
internal abstract class TagHelperResolver : IWorkspaceService
|
||||
{
|
||||
private readonly ITelemetryReporter _telemetryReporter;
|
||||
private readonly ITelemetryReporter? _telemetryReporter;
|
||||
|
||||
public TagHelperResolver(ITelemetryReporter telemetryReporter)
|
||||
public TagHelperResolver(ITelemetryReporter? telemetryReporter = null)
|
||||
{
|
||||
_telemetryReporter = telemetryReporter ?? throw new ArgumentNullException(nameof(telemetryReporter));
|
||||
_telemetryReporter = telemetryReporter;
|
||||
}
|
||||
|
||||
public abstract Task<TagHelperResolutionResult> GetTagHelpersAsync(Project workspaceProject, ProjectSnapshot projectSnapshot, CancellationToken cancellationToken = default);
|
||||
|
@ -71,7 +69,7 @@ namespace Microsoft.CodeAnalysis.Razor
|
|||
timingDictionary[propertyName] = stopWatch.ElapsedMilliseconds;
|
||||
}
|
||||
|
||||
_telemetryReporter.ReportEvent("taghelperresolver/gettaghelpers", VisualStudio.Telemetry.TelemetrySeverity.Normal, timingDictionary.ToImmutableDictionary());
|
||||
_telemetryReporter?.ReportEvent("taghelperresolver/gettaghelpers", VisualStudio.Telemetry.TelemetrySeverity.Normal, timingDictionary.ToImmutableDictionary());
|
||||
return new TagHelperResolutionResult(results, Array.Empty<RazorDiagnostic>());
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Razor.Common.Telemetry;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
using Microsoft.CodeAnalysis.Razor;
|
||||
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
|
||||
|
@ -17,9 +16,9 @@ namespace Microsoft.CodeAnalysis.Remote.Razor
|
|||
{
|
||||
protected readonly ServiceBrokerClient ServiceBrokerClient;
|
||||
|
||||
public RazorServiceBase(IServiceBroker serviceBroker, ITelemetryReporter telemetryReporter)
|
||||
public RazorServiceBase(IServiceBroker serviceBroker)
|
||||
{
|
||||
RazorServices = new RazorServices(telemetryReporter);
|
||||
RazorServices = new RazorServices();
|
||||
|
||||
#pragma warning disable VSTHRD012 // Provide JoinableTaskFactory where allowed
|
||||
ServiceBrokerClient = new ServiceBrokerClient(serviceBroker);
|
||||
|
|
|
@ -12,10 +12,22 @@ using Nerdbank.Streams;
|
|||
|
||||
namespace Microsoft.CodeAnalysis.Remote.Razor
|
||||
{
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <typeparam name="TService"></typeparam>
|
||||
/// <remarks>
|
||||
/// Implementors of <see cref="IServiceHubServiceFactory" /> (and thus this class) MUST provide a parameterless constructor or ServiceHub will fail to construct them.
|
||||
/// </remarks>
|
||||
internal abstract class RazorServiceFactoryBase<TService> : IServiceHubServiceFactory where TService : class
|
||||
{
|
||||
private readonly RazorServiceDescriptorsWrapper _razorServiceDescriptors;
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="razorServiceDescriptors"></param>
|
||||
/// <remarks>
|
||||
/// Implementors of <see cref="IServiceHubServiceFactory" /> (and thus this class) MUST provide a parameterless constructor or ServiceHub will fail to construct them.
|
||||
/// </remarks>
|
||||
public RazorServiceFactoryBase(RazorServiceDescriptorsWrapper razorServiceDescriptors)
|
||||
{
|
||||
_razorServiceDescriptors = razorServiceDescriptors;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.AspNetCore.Razor.Common.Telemetry;
|
||||
|
||||
namespace Microsoft.CodeAnalysis.Razor
|
||||
{
|
||||
// Provides access to Razor language and workspace services that are avialable in the OOP host.
|
||||
|
@ -11,10 +9,10 @@ namespace Microsoft.CodeAnalysis.Razor
|
|||
// that we can construct directly.
|
||||
internal sealed class RazorServices
|
||||
{
|
||||
public RazorServices(ITelemetryReporter telemetryReporter)
|
||||
public RazorServices()
|
||||
{
|
||||
FallbackProjectEngineFactory = new FallbackProjectEngineFactory();
|
||||
TagHelperResolver = new RemoteTagHelperResolver(FallbackProjectEngineFactory, telemetryReporter);
|
||||
TagHelperResolver = new RemoteTagHelperResolver(FallbackProjectEngineFactory);
|
||||
}
|
||||
|
||||
public IFallbackProjectEngineFactory FallbackProjectEngineFactory { get; }
|
||||
|
|
|
@ -5,7 +5,6 @@ using System;
|
|||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Razor.Common.Telemetry;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
using Microsoft.CodeAnalysis.ExternalAccess.Razor;
|
||||
using Microsoft.CodeAnalysis.ExternalAccess.Razor.Api;
|
||||
|
@ -19,8 +18,8 @@ namespace Microsoft.CodeAnalysis.Remote.Razor
|
|||
{
|
||||
private readonly RemoteTagHelperDeltaProvider _tagHelperDeltaProvider;
|
||||
|
||||
internal RemoteTagHelperProviderService(IServiceBroker serviceBroker, ITelemetryReporter telemetryReporter)
|
||||
: base(serviceBroker, telemetryReporter)
|
||||
internal RemoteTagHelperProviderService(IServiceBroker serviceBroker)
|
||||
: base(serviceBroker)
|
||||
{
|
||||
_tagHelperDeltaProvider = new RemoteTagHelperDeltaProvider();
|
||||
}
|
||||
|
|
|
@ -1,21 +1,18 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.AspNetCore.Razor.Common.Telemetry;
|
||||
using Microsoft.ServiceHub.Framework;
|
||||
|
||||
namespace Microsoft.CodeAnalysis.Remote.Razor
|
||||
{
|
||||
internal sealed class RemoteTagHelperProviderServiceFactory : RazorServiceFactoryBase<IRemoteTagHelperProviderService>
|
||||
{
|
||||
private readonly ITelemetryReporter _telemetryReporter;
|
||||
|
||||
public RemoteTagHelperProviderServiceFactory(ITelemetryReporter telemetryReporter) : base(RazorServiceDescriptors.TagHelperProviderServiceDescriptors)
|
||||
// WARNING: We must always have a parameterless constructor in order to be properly handled by ServiceHub.
|
||||
public RemoteTagHelperProviderServiceFactory() : base(RazorServiceDescriptors.TagHelperProviderServiceDescriptors)
|
||||
{
|
||||
_telemetryReporter = telemetryReporter;
|
||||
}
|
||||
|
||||
protected override IRemoteTagHelperProviderService CreateService(IServiceBroker serviceBroker)
|
||||
=> new RemoteTagHelperProviderService(serviceBroker, _telemetryReporter);
|
||||
=> new RemoteTagHelperProviderService(serviceBroker);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Razor.Common.Telemetry;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
|
||||
|
||||
|
@ -16,8 +15,8 @@ namespace Microsoft.CodeAnalysis.Razor
|
|||
|
||||
private readonly IFallbackProjectEngineFactory _fallbackFactory;
|
||||
|
||||
public RemoteTagHelperResolver(IFallbackProjectEngineFactory fallbackFactory, ITelemetryReporter telemetryReporter)
|
||||
: base(telemetryReporter)
|
||||
public RemoteTagHelperResolver(IFallbackProjectEngineFactory fallbackFactory)
|
||||
: base()
|
||||
{
|
||||
if (fallbackFactory is null)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче