Merge remote-tracking branch 'dotnet/main' into extension-testing

This commit is contained in:
Sam Harwell 2021-10-29 08:55:12 -07:00
Родитель 5da1b91b2d 27fe3d6060
Коммит 59cfbb2736
48 изменённых файлов: 1034 добавлений и 418 удалений

Просмотреть файл

@ -12,21 +12,24 @@ variables:
# Branches that trigger a build on commit
trigger:
- main
- dev17.0
stages:
- stage: build
displayName: Build and Test
jobs:
- template: /eng/common/templates/job/onelocbuild.yml
parameters:
LclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-ROSLYNSDK'
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
- template: /eng/common/templates/job/onelocbuild.yml
parameters:
CreatePr: true
LclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-ROSLYNSDK'
- job: OfficialBuild
displayName: Official Build
pool:
name: VSEngSS-MicroBuild2019
name: VSEngSS-MicroBuild2019-1ES
demands:
- cmd

Просмотреть файл

@ -1,3 +1,13 @@
# Branches that trigger a build on commit
trigger:
- main
- dev17.0
# Branches that trigger builds on PR
pr:
- main
- dev17.0
variables:
- name: DOTNET_ROOT
value: $(Build.SourcesDirectory)\.dotnet
@ -7,8 +17,8 @@ variables:
jobs:
- job: Windows
pool:
name: NetCorePublic-Pool
queue: buildpool.windows.10.amd64.vs2019.open
name: NetCore1ESPool-Svc-Public
demands: ImageOverride -equals Build.Windows.10.Amd64.Open
strategy:
maxParallel: 6
matrix:

Просмотреть файл

@ -6,6 +6,7 @@
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
<add key="vssdk" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json" />
<add key="vs-impl" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json" />
<add key="vssdk" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json" />
</packageSources>

Просмотреть файл

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29814.53
# Visual Studio Version 17
VisualStudioVersion = 17.0.31706.66
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{924F7971-780C-4E70-A306-86482469502E}"
EndProject
@ -191,6 +191,10 @@ Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Microsoft.CodeAnalysis.Visu
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Roslyn.ComponentDebugger", "src\VisualStudio.Roslyn.SDK\ComponentDebugger\Roslyn.ComponentDebugger.csproj", "{421DE59C-8246-4679-9D69-79F16A7187BE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "util", "util", "{7A94E723-ADD6-48C4-BBE7-1D5B311187A8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyVersionGenerator", "src\VisualStudio.Roslyn.SDK\AssemblyVersionGenerator\AssemblyVersionGenerator.csproj", "{AB6B3C69-9F6F-461C-BFD8-D3F25B9F44AD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -545,6 +549,10 @@ Global
{421DE59C-8246-4679-9D69-79F16A7187BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{421DE59C-8246-4679-9D69-79F16A7187BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{421DE59C-8246-4679-9D69-79F16A7187BE}.Release|Any CPU.Build.0 = Release|Any CPU
{AB6B3C69-9F6F-461C-BFD8-D3F25B9F44AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB6B3C69-9F6F-461C-BFD8-D3F25B9F44AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB6B3C69-9F6F-461C-BFD8-D3F25B9F44AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB6B3C69-9F6F-461C-BFD8-D3F25B9F44AD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -642,6 +650,7 @@ Global
{7C3FE60E-055B-4E0C-BB85-C7E94A640074} = {9905147E-CC1F-42A0-BD27-05586C583DF7}
{92BD1781-5DB4-4F72-BCCB-0D64C0790A2B} = {9905147E-CC1F-42A0-BD27-05586C583DF7}
{421DE59C-8246-4679-9D69-79F16A7187BE} = {F9B73995-76C6-4056-ADA9-18342F951361}
{AB6B3C69-9F6F-461C-BFD8-D3F25B9F44AD} = {7A94E723-ADD6-48C4-BBE7-1D5B311187A8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {56695AA9-EA80-47A7-8562-E51285906C54}

Просмотреть файл

@ -2,7 +2,7 @@
<Project>
<PropertyGroup>
<!-- This repo version -->
<VersionPrefix>3.2.0</VersionPrefix>
<VersionPrefix>4.0.0</VersionPrefix>
<NugetPackagePrefix>1.1.1</NugetPackagePrefix>
<PreReleaseVersionLabel>beta1</PreReleaseVersionLabel>
<!-- Opt-in repo features -->
@ -17,59 +17,57 @@
</PropertyGroup>
<!-- Dependencies -->
<PropertyGroup>
<!-- Versions used by several individual references below -->
<MicrosoftCodeAnalysisPackagesVersion>4.0.0-1.21267.34</MicrosoftCodeAnalysisPackagesVersion>
<MicrosoftVisualStudioShellPackagesVersion>17.0.0-previews-1-31318-291</MicrosoftVisualStudioShellPackagesVersion>
<MicrosoftVisualStudioEditorPackagesVersion>17.0.65-g6c25c21ba5</MicrosoftVisualStudioEditorPackagesVersion>
<!-- Roslyn -->
<MicrosoftCodeAnalysisAnalyzersVersion>3.3.2</MicrosoftCodeAnalysisAnalyzersVersion>
<MicrosoftCodeAnalysisCommonVersion>3.9.0</MicrosoftCodeAnalysisCommonVersion>
<MicrosoftCodeAnalysisCSharpVersion>3.9.0</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisEditorFeaturesTextVersion>3.9.0</MicrosoftCodeAnalysisEditorFeaturesTextVersion>
<MicrosoftCodeAnalysisVisualBasicVersion>3.9.0</MicrosoftCodeAnalysisVisualBasicVersion>
<MicrosoftCodeAnalysisWorkspacesCommonVersion>3.9.0</MicrosoftCodeAnalysisWorkspacesCommonVersion>
<MicrosoftCodeAnalysisCommonVersion>$(MicrosoftCodeAnalysisPackagesVersion)</MicrosoftCodeAnalysisCommonVersion>
<MicrosoftCodeAnalysisCSharpVersion>$(MicrosoftCodeAnalysisPackagesVersion)</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisEditorFeaturesTextVersion>$(MicrosoftCodeAnalysisPackagesVersion)</MicrosoftCodeAnalysisEditorFeaturesTextVersion>
<MicrosoftCodeAnalysisVisualBasicVersion>$(MicrosoftCodeAnalysisPackagesVersion)</MicrosoftCodeAnalysisVisualBasicVersion>
<MicrosoftCodeAnalysisWorkspacesCommonVersion>$(MicrosoftCodeAnalysisPackagesVersion)</MicrosoftCodeAnalysisWorkspacesCommonVersion>
<!-- We target a lower roslyn API to build internal generators against so they still load in earlier VS versions -->
<MicrosoftCodeAnalysisGeneratorVersion>3.9.0</MicrosoftCodeAnalysisGeneratorVersion>
<!-- VS SDK -->
<EnvDTE80Version>16.9.30921.233</EnvDTE80Version>
<EnvDTE90Version>16.8.30705.32</EnvDTE90Version>
<EnvDTEVersion>16.9.31023.347</EnvDTEVersion>
<MicrosoftInternalVisualStudioShellEmbeddableVersion>16.9.30921.233</MicrosoftInternalVisualStudioShellEmbeddableVersion>
<MicrosoftServiceHubFrameworkVersion>2.7.339</MicrosoftServiceHubFrameworkVersion>
<MicrosoftVisualStudioComponentModelHostVersion>16.8.239</MicrosoftVisualStudioComponentModelHostVersion>
<MicrosoftVisualStudioComposition>16.9.6-alpha</MicrosoftVisualStudioComposition>
<MicrosoftVisualStudioCoreUtilityVersion>16.8.239</MicrosoftVisualStudioCoreUtilityVersion>
<MicrosoftVisualStudioEditorVersion>16.8.239</MicrosoftVisualStudioEditorVersion>
<MicrosoftVisualStudioImageCatalogVersion>16.8.30709.132</MicrosoftVisualStudioImageCatalogVersion>
<MicrosoftVisualStudioImagingInterop140DesignTimeVersion>16.8.30705.32</MicrosoftVisualStudioImagingInterop140DesignTimeVersion>
<MicrosoftVisualStudioImagingVersion>16.8.30406.65-pre</MicrosoftVisualStudioImagingVersion>
<MicrosoftVisualStudioLanguageStandardClassificationVersion>16.8.239</MicrosoftVisualStudioLanguageStandardClassificationVersion>
<MicrosoftVisualStudioProjectSystemManaged>16.8.1-beta1-1008-05</MicrosoftVisualStudioProjectSystemManaged>
<MicrosoftVisualStudioProjectSystemManagedVS>16.8.1-beta1-1008-05</MicrosoftVisualStudioProjectSystemManagedVS>
<MicrosoftVisualStudioRpcContractsVersion>16.9.23-alpha</MicrosoftVisualStudioRpcContractsVersion>
<MicrosoftVisualStudioSDKAnalyzersVersion>16.7.9</MicrosoftVisualStudioSDKAnalyzersVersion>
<MicrosoftVisualStudioShell150Version>16.7.30329.88</MicrosoftVisualStudioShell150Version>
<MicrosoftVisualStudioShellFrameworkVersion>16.7.30329.88</MicrosoftVisualStudioShellFrameworkVersion>
<MicrosoftVisualStudioShellInterop100Version>16.9.30921.233 </MicrosoftVisualStudioShellInterop100Version>
<MicrosoftVisualStudioShellInterop110Version>16.9.30921.233</MicrosoftVisualStudioShellInterop110Version>
<MicrosoftVisualStudioShellInterop121DesignTimeVersion>16.7.30328.74</MicrosoftVisualStudioShellInterop121DesignTimeVersion>
<MicrosoftVisualStudioShellInterop140DesignTimeVersion>16.7.30328.74</MicrosoftVisualStudioShellInterop140DesignTimeVersion>
<MicrosoftVisualStudioShellInterop151DesignTimeVersion>16.9.30921.233</MicrosoftVisualStudioShellInterop151DesignTimeVersion>
<MicrosoftVisualStudioShellInterop153DesignTimeVersion>16.7.30328.74</MicrosoftVisualStudioShellInterop153DesignTimeVersion>
<MicrosoftVisualStudioShellInterop156DesignTimeVersion>16.9.30921.233</MicrosoftVisualStudioShellInterop156DesignTimeVersion>
<MicrosoftVisualStudioShellInterop157DesignTimeVersion>16.7.30328.74</MicrosoftVisualStudioShellInterop157DesignTimeVersion>
<MicrosoftVisualStudioShellInteropVersion>16.9.31023.347</MicrosoftVisualStudioShellInteropVersion>
<MicrosoftVisualStudioShellInterop80Version>16.9.31023.347</MicrosoftVisualStudioShellInterop80Version>
<MicrosoftVisualStudioShellInterop90Version>16.7.30328.74</MicrosoftVisualStudioShellInterop90Version>
<MicrosoftVisualStudioTextDataVersion>16.8.239</MicrosoftVisualStudioTextDataVersion>
<MicrosoftVisualStudioTextLogicVersion>16.8.239</MicrosoftVisualStudioTextLogicVersion>
<MicrosoftVisualStudioTextManagerInterop80Version>16.9.30921.233</MicrosoftVisualStudioTextManagerInterop80Version>
<MicrosoftVisualStudioTextUIWpfVersion>16.8.239</MicrosoftVisualStudioTextUIWpfVersion>
<MicrosoftVisualStudioThreadingVersion>16.8.55</MicrosoftVisualStudioThreadingVersion>
<EnvDTE80Version>$(MicrosoftVisualStudioShellPackagesVersion)</EnvDTE80Version>
<EnvDTEVersion>$(MicrosoftVisualStudioShellPackagesVersion)</EnvDTEVersion>
<MicrosoftServiceHubFrameworkVersion>2.8.2018</MicrosoftServiceHubFrameworkVersion>
<MicrosoftVisualStudioCompositionVersion>16.9.6-alpha</MicrosoftVisualStudioCompositionVersion>
<MicrosoftVisualStudioComponentModelHostVersion>$(MicrosoftVisualStudioEditorPackagesVersion)</MicrosoftVisualStudioComponentModelHostVersion>
<MicrosoftVisualStudioCoreUtilityVersion>$(MicrosoftVisualStudioEditorPackagesVersion)</MicrosoftVisualStudioCoreUtilityVersion>
<MicrosoftVisualStudioEditorVersion>$(MicrosoftVisualStudioEditorPackagesVersion)</MicrosoftVisualStudioEditorVersion>
<MicrosoftVisualStudioImageCatalogVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioImageCatalogVersion>
<MicrosoftVisualStudioImagingInterop140DesignTimeVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioImagingInterop140DesignTimeVersion>
<MicrosoftVisualStudioImagingVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioImagingVersion>
<MicrosoftVisualStudioInteropVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioInteropVersion>
<MicrosoftVisualStudioLanguageStandardClassificationVersion>$(MicrosoftVisualStudioEditorPackagesVersion)</MicrosoftVisualStudioLanguageStandardClassificationVersion>
<MicrosoftVisualStudioSDKAnalyzersVersion>16.9.2-alpha</MicrosoftVisualStudioSDKAnalyzersVersion>
<MicrosoftVisualStudioShell150Version>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioShell150Version>
<MicrosoftVisualStudioShellFrameworkVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioShellFrameworkVersion>
<MicrosoftVisualStudioShellInteropVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioShellInteropVersion>
<MicrosoftVisualStudioTextDataVersion>$(MicrosoftVisualStudioEditorPackagesVersion)</MicrosoftVisualStudioTextDataVersion>
<MicrosoftVisualStudioTextLogicVersion>$(MicrosoftVisualStudioEditorPackagesVersion)</MicrosoftVisualStudioTextLogicVersion>
<MicrosoftVisualStudioTextManagerInterop80Version>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioTextManagerInterop80Version>
<MicrosoftVisualStudioTextUIWpfVersion>$(MicrosoftVisualStudioEditorPackagesVersion)</MicrosoftVisualStudioTextUIWpfVersion>
<MicrosoftVisualStudioThreadingVersion>17.0.15-alpha</MicrosoftVisualStudioThreadingVersion>
<MicrosoftVisualStudioUtilitiesInternalVersion>16.3.23</MicrosoftVisualStudioUtilitiesInternalVersion>
<MicrosoftVisualStudioValidationVersion>16.8.33</MicrosoftVisualStudioValidationVersion>
<NuGetSolutionRestoreManagerInteropVersion>5.8.0-preview.2.6776</NuGetSolutionRestoreManagerInteropVersion>
<NuGetVisualStudio>5.8.0-preview.2.6776</NuGetVisualStudio>
<RoslynToolsSignTool>1.1.0-beta3.20374.2</RoslynToolsSignTool>
<MicrosoftVisualStudioValidationVersion>17.0.11-alpha</MicrosoftVisualStudioValidationVersion>
<NuGetSolutionRestoreManagerInteropVersion>5.6.0</NuGetSolutionRestoreManagerInteropVersion>
<StreamJsonRpcVersion>2.7.67</StreamJsonRpcVersion>
<VSLangProjVersion>16.7.30508.193</VSLangProjVersion>
<VSSDKTemplateWizardInterfaceVersion>12.0.4</VSSDKTemplateWizardInterfaceVersion>
<VSLangProjVersion>$(MicrosoftVisualStudioShellPackagesVersion)</VSLangProjVersion>
<MicrosoftVisualStudioTemplateWizardInterfaceVersion>17.0.0-preview-1-30928-1111</MicrosoftVisualStudioTemplateWizardInterfaceVersion>
<MicrosoftVSSDKBuildToolsVersion>17.0.1056-Dev17PIAs-g9dffd635</MicrosoftVSSDKBuildToolsVersion>
<MicroBuildPluginsSwixBuildVersion>1.1.33</MicroBuildPluginsSwixBuildVersion>
<SystemThreadingTasksDataflowVersion>5.0.0</SystemThreadingTasksDataflowVersion>
<!-- Project System-->
<MicrosoftVisualStudioProjectSystemManagedVersion>17.0.0-beta1-10413-02</MicrosoftVisualStudioProjectSystemManagedVersion>
<MicrosoftVisualStudioProjectSystemManagedVSVersion>17.0.0-beta1-10413-02</MicrosoftVisualStudioProjectSystemManagedVSVersion>
<MicrosoftVisualStudioProjectSystemSDKToolsVersion>17.0.667-pre</MicrosoftVisualStudioProjectSystemSDKToolsVersion>
<!-- Libs -->
<DiffPlexVersion>1.4.4</DiffPlexVersion>
<DiffPlexVersion>1.5.0</DiffPlexVersion>
<SystemNetHttpVersion>4.3.4</SystemNetHttpVersion>
<!-- Testing -->
<MicrosoftCodeAnalysis2PrimaryTestVersion>2.6.1</MicrosoftCodeAnalysis2PrimaryTestVersion>
<MicrosoftCodeAnalysis3PrimaryTestVersion>3.9.0</MicrosoftCodeAnalysis3PrimaryTestVersion>

Просмотреть файл

@ -17,17 +17,15 @@ using Microsoft.CodeAnalysis.Simplification;
namespace MakeConst
{
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(MakeConstCodeFixProvider)), Shared]
public class MakeConstCodeFixProvider : CodeFixProvider
public sealed class MakeConstCodeFixProvider : CodeFixProvider
{
private const string title = "Make uppercase";
public sealed override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(MakeConstAnalyzer.MakeConstDiagnosticId);
public sealed override FixAllProvider GetFixAllProvider() => WellKnownFixAllProviders.BatchFixer;
public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
{
SyntaxNode root = await context.Document.GetSyntaxRootAsync(context.CancellationToken);
SyntaxNode root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
Diagnostic diagnostic = context.Diagnostics.First();
Microsoft.CodeAnalysis.Text.TextSpan diagnosticSpan = diagnostic.Location.SourceSpan;
@ -44,7 +42,7 @@ namespace MakeConst
context.RegisterCodeFix(action, diagnostic);
}
private async Task<Document> MakeConstAsync(Document document, LocalDeclarationStatementSyntax localDeclaration, CancellationToken cancellationToken)
private static async Task<Document> MakeConstAsync(Document document, LocalDeclarationStatementSyntax localDeclaration, CancellationToken cancellationToken)
{
// Remove the leading trivia from the local declaration.
SyntaxToken firstToken = localDeclaration.GetFirstToken();
@ -64,15 +62,15 @@ namespace MakeConst
TypeSyntax variableTypeName = variableDeclaration.Type;
if (variableTypeName.IsVar)
{
SemanticModel semanticModel = await document.GetSemanticModelAsync(cancellationToken);
SemanticModel semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
// Special case: Ensure that 'var' isn't actually an alias to another type
// (e.g. using var = System.String).
IAliasSymbol aliasInfo = semanticModel.GetAliasInfo(variableTypeName);
IAliasSymbol aliasInfo = semanticModel.GetAliasInfo(variableTypeName, cancellationToken);
if (aliasInfo == null)
{
// Retrieve the type inferred for var.
ITypeSymbol type = semanticModel.GetTypeInfo(variableTypeName).ConvertedType;
ITypeSymbol type = semanticModel.GetTypeInfo(variableTypeName, cancellationToken).ConvertedType;
// Special case: Ensure that 'var' isn't actually a type named 'var'.
if (type.Name != "var")
@ -100,7 +98,7 @@ namespace MakeConst
LocalDeclarationStatementSyntax formattedLocal = newLocal.WithAdditionalAnnotations(Formatter.Annotation);
// Replace the old local declaration with the new local declaration.
SyntaxNode root = await document.GetSyntaxRootAsync(cancellationToken);
SyntaxNode root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
SyntaxNode newRoot = root.ReplaceNode(localDeclaration, formattedLocal);
// Return document with transformed tree.

Просмотреть файл

@ -28,7 +28,7 @@ You can add the sample generators to your own project by adding an item group co
```xml
<ItemGroup>
<Analyzer Include="path\to\SourceGeneratorSamples.dll">
<Analyzer Include="path\to\SourceGeneratorSamples.dll"/>
</ItemGroup>
```

Просмотреть файл

@ -13,4 +13,8 @@
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<ItemGroup>
<PackageReference Include="System.Net.Http" Version="$(SystemNetHttpVersion)" PrivateAssets="all" ExcludeAssets="all" />
</ItemGroup>
</Project>

Просмотреть файл

@ -12,23 +12,24 @@ Imports Microsoft.CodeAnalysis.VisualBasic
Imports Microsoft.CodeAnalysis.VisualBasic.Syntax
<ExportCodeFixProvider(LanguageNames.VisualBasic, Name:="MakeConstVB"), [Shared]>
Public Class MakeConstCodeFixProvider
Public NotInheritable Class MakeConstCodeFixProvider
Inherits CodeFixProvider
Public NotOverridable Overrides ReadOnly Property FixableDiagnosticIds As ImmutableArray(Of String)
Public Overrides ReadOnly Property FixableDiagnosticIds As ImmutableArray(Of String)
Get
Return ImmutableArray.Create(MakeConstAnalyzer.MakeConstDiagnosticId)
End Get
End Property
Public NotOverridable Overrides Function GetFixAllProvider() As FixAllProvider
Return Nothing
Public Overrides Function GetFixAllProvider() As FixAllProvider
' See https://github.com/dotnet/roslyn/blob/master/docs/analyzers/FixAllProvider.md for more information on Fix All Providers
Return WellKnownFixAllProviders.BatchFixer
End Function
Public NotOverridable Overrides Async Function RegisterCodeFixesAsync(context As CodeFixContext) As Task
Public Overrides Async Function RegisterCodeFixesAsync(context As CodeFixContext) As Task
Dim diagnostic = context.Diagnostics.First()
Dim diagnosticSpan = diagnostic.Location.SourceSpan
Dim root = Await context.Document.GetSyntaxRootAsync(context.CancellationToken)
Dim root = Await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(False)
' Find the local declaration identified by the diagnostic.
Dim declaration = root.FindToken(diagnosticSpan.Start).Parent.AncestorsAndSelf().OfType(Of LocalDeclarationStatementSyntax)().First()
@ -42,7 +43,7 @@ Public Class MakeConstCodeFixProvider
context.RegisterCodeFix(action, diagnostic)
End Function
Private Async Function MakeConstAsync(document As Document, localDeclaration As LocalDeclarationStatementSyntax, cancellationToken As CancellationToken) As Task(Of Document)
Private Shared Async Function MakeConstAsync(document As Document, localDeclaration As LocalDeclarationStatementSyntax, cancellationToken As CancellationToken) As Task(Of Document)
' Create a const token with the leading trivia from the local declaration.
Dim firstToken = localDeclaration.GetFirstToken()
Dim constToken = SyntaxFactory.Token(
@ -58,7 +59,7 @@ Public Class MakeConstCodeFixProvider
Dim formattedLocalDeclaration = newLocalDeclaration.WithAdditionalAnnotations(Formatter.Annotation)
' Replace the old local declaration with the new local declaration.
Dim root = Await document.GetSyntaxRootAsync(cancellationToken)
Dim root = Await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(False)
Dim newRoot = root.ReplaceNode(localDeclaration, formattedLocalDeclaration)
' Return document with transformed tree.

Просмотреть файл

@ -88,7 +88,7 @@
<!-- Public API Analyzer configuration -->
<ItemGroup>
<PackageReference Include="Roslyn.Diagnostics.Analyzers" Version="$(RoslynDiagnosticsAnalyzersVersion)" PrivateAssets="all" />
<PackageReference Include="System.Net.Http" Version="$(SystemNetHttpVersion)" PrivateAssets="all" ExcludeAssets="all" />
<AdditionalFiles Include="PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI.Unshipped.txt" />
</ItemGroup>

Просмотреть файл

@ -2,14 +2,12 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DiffPlex;
using DiffPlex.Chunkers;
using DiffPlex.DiffBuilder;
using DiffPlex.DiffBuilder.Model;
using DiffPlex.Model;
namespace Microsoft.CodeAnalysis.Testing
{
@ -18,8 +16,9 @@ namespace Microsoft.CodeAnalysis.Testing
/// </summary>
public static class IVerifierExtensions
{
private static readonly InlineDiffBuilder s_diffWithoutLineEndings = new InlineDiffBuilder(new Differ());
private static readonly InlineDiffBuilder s_diffWithLineEndings = new InlineDiffBuilder(new DifferWithLineEndings());
private static readonly IChunker s_lineChunker = new LineChunker();
private static readonly IChunker s_lineEndingsPreservingChunker = new LineEndingsPreservingChunker();
private static readonly InlineDiffBuilder s_diffBuilder = new InlineDiffBuilder(new Differ());
/// <summary>
/// Asserts that two strings are equal, and prints a diff between the two if they are not.
@ -34,7 +33,7 @@ namespace Microsoft.CodeAnalysis.Testing
if (expected != actual)
{
var diff = s_diffWithoutLineEndings.BuildDiffModel(expected, actual, ignoreWhitespace: false);
var diff = s_diffBuilder.BuildDiffModel(expected, actual, ignoreWhitespace: false, ignoreCase: false, s_lineChunker);
var messageBuilder = new StringBuilder();
messageBuilder.AppendLine(
string.IsNullOrEmpty(message)
@ -44,7 +43,7 @@ namespace Microsoft.CodeAnalysis.Testing
if (!diff.Lines.Any(line => line.Type == ChangeType.Inserted || line.Type == ChangeType.Deleted))
{
// We have a failure only caused by line ending differences; recalculate with line endings visible
diff = s_diffWithLineEndings.BuildDiffModel(expected, actual, ignoreWhitespace: false);
diff = s_diffBuilder.BuildDiffModel(expected, actual, ignoreWhitespace: false, ignoreCase: false, s_lineEndingsPreservingChunker);
}
foreach (var line in diff.Lines)
@ -62,86 +61,11 @@ namespace Microsoft.CodeAnalysis.Testing
break;
}
messageBuilder.AppendLine(line.Text);
messageBuilder.AppendLine(line.Text.Replace("\r", "<CR>").Replace("\n", "<LF>"));
}
verifier.Fail(messageBuilder.ToString());
}
}
private class DifferWithLineEndings : IDiffer
{
private const string CarriageReturnText = "<CR>";
private const string LineFeedText = "<LF>";
private static readonly char[] s_endOfLineCharacters = { '\r', '\n' };
private static readonly Differ s_differ = new Differ();
public DiffResult CreateCharacterDiffs(string oldText, string newText, bool ignoreWhitespace)
=> s_differ.CreateCharacterDiffs(oldText, newText, ignoreWhitespace);
public DiffResult CreateCharacterDiffs(string oldText, string newText, bool ignoreWhitespace, bool ignoreCase)
=> s_differ.CreateCharacterDiffs(oldText, newText, ignoreWhitespace, ignoreCase);
public DiffResult CreateCustomDiffs(string oldText, string newText, bool ignoreWhiteSpace, Func<string, string[]> chunker)
=> s_differ.CreateCustomDiffs(oldText, newText, ignoreWhiteSpace, chunker);
public DiffResult CreateCustomDiffs(string oldText, string newText, bool ignoreWhiteSpace, bool ignoreCase, Func<string, string[]> chunker)
=> s_differ.CreateCustomDiffs(oldText, newText, ignoreWhiteSpace, ignoreCase, chunker);
public DiffResult CreateLineDiffs(string oldText, string newText, bool ignoreWhitespace)
=> CreateLineDiffs(oldText, newText, ignoreWhitespace, ignoreCase: false);
public DiffResult CreateLineDiffs(string oldText, string newText, bool ignoreWhitespace, bool ignoreCase)
{
Func<string, string[]> chunker = s =>
{
var lines = new List<string>();
var nextChar = 0;
while (nextChar < s.Length)
{
var nextEol = s.IndexOfAny(s_endOfLineCharacters, nextChar);
if (nextEol == -1)
{
lines.Add(s.Substring(nextChar));
break;
}
var currentLine = s.Substring(nextChar, nextEol - nextChar);
switch (s[nextEol])
{
case '\r':
currentLine += CarriageReturnText;
if (nextEol < s.Length - 1 && s[nextEol + 1] == '\n')
{
currentLine += LineFeedText;
nextEol++;
}
break;
case '\n':
currentLine += LineFeedText;
break;
}
lines.Add(currentLine);
nextChar = nextEol + 1;
}
return lines.ToArray();
};
return CreateCustomDiffs(oldText, newText, ignoreWhitespace, ignoreCase, chunker);
}
public DiffResult CreateWordDiffs(string oldText, string newText, bool ignoreWhitespace, char[] separators)
=> s_differ.CreateWordDiffs(oldText, newText, ignoreWhitespace, separators);
public DiffResult CreateWordDiffs(string oldText, string newText, bool ignoreWhitespace, bool ignoreCase, char[] separators)
=> s_differ.CreateWordDiffs(oldText, newText, ignoreWhitespace, ignoreCase, separators);
}
}
}

Просмотреть файл

@ -176,6 +176,7 @@ Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net
Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetCore
Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework
Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net20
Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net35
Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net40
Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net45
Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net451
@ -252,6 +253,13 @@ static Microsoft.CodeAnalysis.Testing.DiagnosticResult.CompilerWarning(string id
static Microsoft.CodeAnalysis.Testing.IVerifierExtensions.EqualOrDiff(this Microsoft.CodeAnalysis.Testing.IVerifier verifier, string expected, string actual, string message = null) -> void
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Default.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net50.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net60.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net60Android.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net60MacCatalyst.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net60MacOS.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net60TvOS.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net60Windows.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net60iOS.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetCore.NetCoreApp10.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetCore.NetCoreApp11.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetCore.NetCoreApp20.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
@ -260,6 +268,9 @@ static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetCore.NetCoreApp30.g
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetCore.NetCoreApp31.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net20.Default.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net20.WindowsForms.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net35.Default.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net35.WindowsForms.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net35.Wpf.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net40.Default.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net40.WindowsForms.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetFramework.Net40.Wpf.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies

Просмотреть файл

@ -27,7 +27,7 @@ namespace Microsoft.CodeAnalysis.Testing
{
public sealed partial class ReferenceAssemblies
{
private const string ReferenceAssembliesPackageVersion = "1.0.0";
private const string ReferenceAssembliesPackageVersion = "1.0.2";
private static readonly FileSystemSemaphore Semaphore = new FileSystemSemaphore(Path.Combine(Path.GetTempPath(), "test-packages", ".lock"));
@ -323,7 +323,7 @@ namespace Microsoft.CodeAnalysis.Testing
var downloadResult = await downloadResource.GetDownloadResourceResultAsync(
packageToInstall,
new PackageDownloadContext(cacheContext),
SettingsUtility.GetGlobalPackagesFolder(settings),
temporaryPackagesFolder,
logger,
cancellationToken);
@ -579,6 +579,26 @@ namespace Microsoft.CodeAnalysis.Testing
= Default.AddAssemblies(ImmutableArray.Create("System.Drawing", "System.Windows.Forms"));
}
public static class Net35
{
public static ReferenceAssemblies Default { get; }
= new ReferenceAssemblies(
"net35",
new PackageIdentity(
"Microsoft.NETFramework.ReferenceAssemblies.net35",
ReferenceAssembliesPackageVersion),
Path.Combine("build", ".NETFramework", "v3.5"))
.WithAssemblyIdentityComparer(DesktopAssemblyIdentityComparer.Default)
.AddAssemblies(ImmutableArray.Create("mscorlib", "System", "System.Core", "System.Data", "System.Data.DataSetExtensions", "System.Xml", "System.Xml.Linq"))
.AddLanguageSpecificAssemblies(LanguageNames.VisualBasic, ImmutableArray.Create("Microsoft.VisualBasic"));
public static ReferenceAssemblies WindowsForms { get; }
= Default.AddAssemblies(ImmutableArray.Create("System.Deployment", "System.Drawing", "System.Windows.Forms"));
public static ReferenceAssemblies Wpf { get; }
= Default.AddAssemblies(ImmutableArray.Create("PresentationCore", "PresentationFramework", "WindowsBase"));
}
public static class Net40
{
public static ReferenceAssemblies Default { get; }
@ -865,7 +885,74 @@ namespace Microsoft.CodeAnalysis.Testing
Path.Combine("ref", "net5.0"));
});
private static readonly Lazy<ReferenceAssemblies> _lazyNet60 =
new Lazy<ReferenceAssemblies>(() =>
{
if (!NuGetFramework.Parse("net6.0").IsPackageBased)
{
// The NuGet version provided at runtime does not recognize the 'net6.0' target framework
throw new NotSupportedException("The 'net6.0' target framework is not supported by this version of NuGet.");
}
return new ReferenceAssemblies(
"net6.0",
new PackageIdentity(
"Microsoft.NETCore.App.Ref",
"6.0.0-rc.1.21451.13"),
Path.Combine("ref", "net6.0"));
});
private static readonly Lazy<ReferenceAssemblies> _lazyNet60Windows =
new Lazy<ReferenceAssemblies>(() =>
Net60.AddPackages(
ImmutableArray.Create(
new PackageIdentity("Microsoft.WindowsDesktop.App.Ref", "6.0.0-rc.1.21451.3"))));
private static readonly Lazy<ReferenceAssemblies> _lazyNet60Android =
new Lazy<ReferenceAssemblies>(() =>
Net60.AddPackages(
ImmutableArray.Create(
new PackageIdentity("Microsoft.Android.Ref", "31.0.100-rc.1.12"))));
private static readonly Lazy<ReferenceAssemblies> _lazyNet60iOS =
new Lazy<ReferenceAssemblies>(() =>
Net60.AddPackages(
ImmutableArray.Create(
new PackageIdentity("Microsoft.iOS.Ref", "15.0.100-rc.1.1534"))));
private static readonly Lazy<ReferenceAssemblies> _lazyNet60MacOS =
new Lazy<ReferenceAssemblies>(() =>
Net60.AddPackages(
ImmutableArray.Create(
new PackageIdentity("Microsoft.macOS.Ref", "12.0.100-rc.1.1534"))));
private static readonly Lazy<ReferenceAssemblies> _lazyNet60MacCatalyst =
new Lazy<ReferenceAssemblies>(() =>
Net60.AddPackages(
ImmutableArray.Create(
new PackageIdentity("Microsoft.MacCatalyst.Ref", "15.0.100-rc.1.1534"))));
private static readonly Lazy<ReferenceAssemblies> _lazyNet60TvOS =
new Lazy<ReferenceAssemblies>(() =>
Net60.AddPackages(
ImmutableArray.Create(
new PackageIdentity("Microsoft.tvOS.Ref", "15.0.100-rc.1.1534"))));
public static ReferenceAssemblies Net50 => _lazyNet50.Value;
public static ReferenceAssemblies Net60 => _lazyNet60.Value;
public static ReferenceAssemblies Net60Windows => _lazyNet60Windows.Value;
public static ReferenceAssemblies Net60Android => _lazyNet60Android.Value;
public static ReferenceAssemblies Net60iOS => _lazyNet60iOS.Value;
public static ReferenceAssemblies Net60MacOS => _lazyNet60MacOS.Value;
public static ReferenceAssemblies Net60MacCatalyst => _lazyNet60MacCatalyst.Value;
public static ReferenceAssemblies Net60TvOS => _lazyNet60TvOS.Value;
}
public static class NetStandard

Просмотреть файл

@ -0,0 +1,24 @@
using System;
using System.Diagnostics;
using Microsoft.CodeAnalysis;
namespace AssemblyVersionGenerator
{
[Generator]
public class AssemblyVersionGenerator : ISourceGenerator
{
public void Execute(GeneratorExecutionContext context)
{
context.AddSource("assemblyversion.g.cs", $@"
internal class AssemblyVersion
{{
public const string Version = ""{context.Compilation.Assembly.Identity.Version}"";
}}");
}
public void Initialize(GeneratorInitializationContext context)
{
}
}
}

Просмотреть файл

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Nullable>enable</Nullable>
<IsRoslynComponent>true</IsRoslynComponent>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="$(MicrosoftCodeAnalysisGeneratorVersion)" />
</ItemGroup>
</Project>

Просмотреть файл

@ -50,7 +50,7 @@ namespace Roslyn.ComponentDebugger
ruleNames: Constants.CommandLineArgsRuleName);
}
protected override Task<IProjectVersionedValue<ImmutableArray<string>>> PreprocessAsync(IProjectVersionedValue<IProjectSubscriptionUpdate> input, IProjectVersionedValue<ImmutableArray<string>>? previousOutput)
protected override Task<IProjectVersionedValue<ImmutableArray<string>>?> PreprocessAsync(IProjectVersionedValue<IProjectSubscriptionUpdate>? input, IProjectVersionedValue<ImmutableArray<string>>? previousOutput)
{
if (input is null)
{
@ -58,7 +58,7 @@ namespace Roslyn.ComponentDebugger
}
var description = input.Value.ProjectChanges[Constants.CommandLineArgsRuleName];
return Task.FromResult<IProjectVersionedValue<ImmutableArray<string>>>(new ProjectVersionedValue<ImmutableArray<string>>(description.After.Items.Keys.ToImmutableArray(), input.DataSourceVersions));
return Task.FromResult<IProjectVersionedValue<ImmutableArray<string>>?>(new ProjectVersionedValue<ImmutableArray<string>>(description.After.Items.Keys.ToImmutableArray(), input.DataSourceVersions));
}
protected override Task ApplyAsync(IProjectVersionedValue<ImmutableArray<string>> value)

Просмотреть файл

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8" ?>
<Rule Name="ComponentDebuggerLaunchProfile"
Description="Allows a user to debug a Roslyn Component by running it in the context of another projects build."
DisplayName="Roslyn Component"
PageTemplate="commandNameBasedDebugger"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/build/2009/properties">
<Rule.Metadata>
<sys:String x:Key="CommandName">DebugRoslynComponent</sys:String>
<!-- KnownImageIds.ImageCatalogGuid -->
<sys:Guid x:Key="ImageMonikerGuid">AE27A6B0-E345-4288-96DF-5EAF394EE369</sys:Guid>
<!-- KnownImageIds.Execute -->
<sys:Int32 x:Key="ImageMonikerId">3644</sys:Int32>
</Rule.Metadata>
<Rule.DataSource>
<DataSource Persistence="LaunchProfile"
HasConfigurationCondition="False"
ItemType="LaunchProfile"/>
</Rule.DataSource>
<DynamicEnumProperty Name="targetProject"
DisplayName="Target Project"
Description="A project that uses this component, whose compilation will be debugged."
EnumProvider="TargetProjectEnumProvider" />
<StringProperty Name="Description"
Description="A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list.">
<StringProperty.DataSource>
<DataSource PersistedName="Description"
Persistence="ProjectFileWithInterception"
HasConfigurationCondition="False" />
</StringProperty.DataSource>
<StringProperty.ValueEditors>
<ValueEditor EditorType="Description" />
</StringProperty.ValueEditors>
</StringProperty>
</Rule>

Просмотреть файл

@ -1,19 +0,0 @@
<UserControl x:Class="Roslyn.ComponentDebugger.DebuggerOptions"
x:ClassModifier="internal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="Auto"
HorizontalAlignment="Left"
VerticalAlignment="Top">
<Grid Margin="0,2,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="158" />
<ColumnDefinition Width="350" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- https://github.com/dotnet/roslyn-sdk/issues/730 : Localization -->
<Label Margin="4,4,3,5">Target Project:</Label>
<ComboBox Grid.Column="1" Margin="5,7,2,6" ItemsSource="{Binding ProjectNames}" SelectedIndex="{Binding SelectedProjectIndex, Mode=TwoWay}" />
</Grid>
</UserControl>

Просмотреть файл

@ -1,14 +0,0 @@
// 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.
namespace Roslyn.ComponentDebugger
{
partial class DebuggerOptions
{
public DebuggerOptions()
{
InitializeComponent();
}
}
}

Просмотреть файл

@ -1,61 +0,0 @@
// 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 System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Roslyn.ComponentDebugger
{
internal sealed class DebuggerOptionsViewModel : INotifyPropertyChanged
{
private readonly Action<int> _indexChanged;
private IEnumerable<string> _projectNames = ImmutableArray<string>.Empty;
private int _selectedProjectIndex = -1;
public event PropertyChangedEventHandler? PropertyChanged;
public DebuggerOptionsViewModel(Action<int> indexChanged)
{
_indexChanged = indexChanged;
}
public IEnumerable<string> ProjectNames
{
get => _projectNames;
set
{
if (!_projectNames.SequenceEqual(value))
{
_projectNames = value;
NotifyPropertyChanged();
}
}
}
public int SelectedProjectIndex
{
get => _selectedProjectIndex;
set
{
if (_selectedProjectIndex != value)
{
_selectedProjectIndex = value;
NotifyPropertyChanged();
_indexChanged?.Invoke(value);
}
}
}
private void NotifyPropertyChanged([CallerMemberName]string propertyName = "")
{
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}

Просмотреть файл

@ -38,22 +38,5 @@ namespace Roslyn.ComponentDebugger
}
return targetProject;
}
public void WriteProjectForLaunch(IWritableLaunchProfile profile, UnconfiguredProject targetProject)
{
if (profile is null)
{
throw new System.ArgumentNullException(nameof(profile));
}
if (targetProject is null)
{
throw new System.ArgumentNullException(nameof(targetProject));
}
var rootedPath = _owningProject.MakeRelative(targetProject.FullPath);
profile.OtherSettings[Constants.TargetProjectKeyName] = rootedPath;
}
}
}

Просмотреть файл

@ -1,101 +0,0 @@
// 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 System;
using System.Collections.Immutable;
using System.ComponentModel.Composition;
using System.IO;
using System.Linq;
using System.Windows.Controls;
using Microsoft.VisualStudio.ProjectSystem;
using Microsoft.VisualStudio.ProjectSystem.Debug;
using Microsoft.VisualStudio.Utilities;
using Task = System.Threading.Tasks.Task;
namespace Roslyn.ComponentDebugger
{
[Export(typeof(ILaunchSettingsUIProvider))]
[AppliesTo(Constants.RoslynComponentCapability)]
public class LaunchSettingsProvider : ILaunchSettingsUIProvider
{
private readonly IProjectThreadingService _threadingService;
private readonly UnconfiguredProject _unconfiguredProject;
private readonly LaunchSettingsManager _launchSettingsManager;
private readonly DebuggerOptionsViewModel _viewModel;
private ImmutableArray<UnconfiguredProject> _projects;
private IWritableLaunchProfile? _launchProfile;
[ImportingConstructor]
[Obsolete("This exported object must be obtained through the MEF export provider.", error: true)]
public LaunchSettingsProvider(IProjectThreadingService threadingService, UnconfiguredProject unconfiguredProject, LaunchSettingsManager launchSettingsManager)
{
_threadingService = threadingService;
_unconfiguredProject = unconfiguredProject;
_launchSettingsManager = launchSettingsManager;
_viewModel = new DebuggerOptionsViewModel(IndexChanged);
}
public string CommandName { get => Constants.CommandName; }
// https://github.com/dotnet/roslyn-sdk/issues/730 : localization
public string FriendlyName { get => "Roslyn Component"; }
public UserControl? CustomUI { get => new DebuggerOptions() { DataContext = _viewModel }; }
public void ProfileSelected(IWritableLaunchSettings curSettings)
{
_launchProfile = curSettings?.ActiveProfile;
_threadingService.ExecuteSynchronously(UpdateViewModelAsync);
}
public bool ShouldEnableProperty(string propertyName)
{
// we disable all the default options for a debugger.
// in the future we might want to enable env vars and (potentially) the exe to allow
// customization of the compiler used?
return false;
}
private async Task UpdateViewModelAsync()
{
var targetProjects = ArrayBuilder<UnconfiguredProject>.GetInstance();
// get the output assembly for this project
var projectArgs = await _unconfiguredProject.GetCompilationArgumentsAsync().ConfigureAwait(false);
var targetArg = projectArgs.LastOrDefault(a => a.StartsWith("/out:", StringComparison.OrdinalIgnoreCase));
var target = Path.GetFileName(targetArg);
var projectService = _unconfiguredProject.Services.ProjectService;
foreach (var targetProjectUnconfigured in projectService.LoadedUnconfiguredProjects)
{
// check if the args contain the project as an analyzer ref
foreach (var arg in await targetProjectUnconfigured.GetCompilationArgumentsAsync().ConfigureAwait(false))
{
if (arg.StartsWith("/analyzer:", StringComparison.OrdinalIgnoreCase)
&& arg.EndsWith(target, StringComparison.OrdinalIgnoreCase))
{
targetProjects.Add(targetProjectUnconfigured);
}
}
}
_projects = targetProjects.ToImmutableAndFree();
var launchTargetProject = await _launchSettingsManager.TryGetProjectForLaunchAsync(_launchProfile?.ToLaunchProfile()).ConfigureAwait(true);
var index = _projects.IndexOf(launchTargetProject!);
_viewModel.ProjectNames = _projects.Select(p => Path.GetFileNameWithoutExtension(p.FullPath));
_viewModel.SelectedProjectIndex = index;
}
private void IndexChanged(int newIndex)
{
if (_launchProfile is object && !_projects.IsDefaultOrEmpty && newIndex >= 0 && newIndex < _projects.Length)
{
var project = _projects[newIndex];
_launchSettingsManager.WriteProjectForLaunch(_launchProfile, project);
}
}
}
}

Просмотреть файл

@ -4,13 +4,41 @@
using System;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.VisualStudio.ProjectSystem;
using Microsoft.VisualStudio.Utilities;
namespace Roslyn.ComponentDebugger
{
public static class ProjectUtilities
{
public static async Task<ImmutableArray<UnconfiguredProject>> GetComponentReferencingProjectsAsync(this UnconfiguredProject unconfiguredProject)
{
var targetProjects = ArrayBuilder<UnconfiguredProject>.GetInstance();
// get the output assembly for this project
var projectArgs = await unconfiguredProject.GetCompilationArgumentsAsync().ConfigureAwait(false);
var targetArg = projectArgs.LastOrDefault(a => a.StartsWith("/out:", StringComparison.OrdinalIgnoreCase));
var target = Path.GetFileName(targetArg);
var projectService = unconfiguredProject.Services.ProjectService;
foreach (var targetProjectUnconfigured in projectService.LoadedUnconfiguredProjects)
{
// check if the args contain the project as an analyzer ref
foreach (var arg in await targetProjectUnconfigured.GetCompilationArgumentsAsync().ConfigureAwait(false))
{
if (arg.StartsWith("/analyzer:", StringComparison.OrdinalIgnoreCase)
&& arg.EndsWith(target, StringComparison.OrdinalIgnoreCase))
{
targetProjects.Add(targetProjectUnconfigured);
}
}
}
return targetProjects.ToImmutableAndFree();
}
public static Task<ImmutableArray<string>> GetCompilationArgumentsAsync(this UnconfiguredProject project)
{
if (project is null)

Просмотреть файл

@ -7,25 +7,29 @@
<TargetFramework>net472</TargetFramework>
<Nullable>enable</Nullable>
<UseWpf>true</UseWpf>
<NoWarn>$(NoWarn);NU1603;NU1605</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EnvDTE80" Version="$(EnvDTE80Version)" PrivateAssets="all" />
<PackageReference Include="EnvDTE90" Version="$(EnvDTE90Version)" PrivateAssets="all" />
<PackageReference Include="EnvDTE" Version="$(EnvDTEVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.Internal.VisualStudio.Shell.Embeddable" Version="$(MicrosoftInternalVisualStudioShellEmbeddableVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.Managed" Version="$(MicrosoftVisualStudioProjectSystemManaged)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.Managed.VS" Version="$(MicrosoftVisualStudioProjectSystemManagedVS)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Imaging" Version="$(MicrosoftVisualStudioImagingVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Composition" Version="$(MicrosoftVisualStudioComposition)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop" Version="$(MicrosoftVisualStudioShellInteropVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.8.0" Version="$(MicrosoftVisualStudioShellInterop80Version)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.15.1.DesignTime" Version="$(MicrosoftVisualStudioShellInterop151DesignTimeVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime" Version="$(MicrosoftVisualStudioShellInterop156DesignTimeVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.RpcContracts" Version="$(MicrosoftVisualStudioRpcContractsVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.ServiceHub.Framework" Version="$(MicrosoftServiceHubFrameworkVersion)" PrivateAssets="all" />
<PackageReference Include="NuGet.SolutionRestoreManager.Interop" Version="$(NuGetSolutionRestoreManagerInteropVersion)" PrivateAssets="all" />
<PackageReference Include="NuGet.VisualStudio" Version="$(NuGetVisualStudio)" PrivateAssets="all" />
<PackageReference Include="RoslynTools.SignTool" Version="$(RoslynToolsSignTool)" PrivateAssets="all" />
<PackageReference Include="StreamJsonRpc" Version="$(StreamJsonRpcVersion)" PrivateAssets="all" />
<Page Remove="ComponentDebuggerLaunchProfile.xaml" />
<XamlPropertyRule Include="ComponentDebuggerLaunchProfile.xaml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
<Generator>MSBuild:GenerateRuleSourceFromXaml</Generator>
<SubType>Designer</SubType>
<DataAccess>None</DataAccess>
<RuleInjection>None</RuleInjection>
</XamlPropertyRule>
</ItemGroup>
</Project>
<ItemGroup>
<ProjectReference Include="..\AssemblyVersionGenerator\AssemblyVersionGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.Managed" Version="$(MicrosoftVisualStudioProjectSystemManagedVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.Managed.VS" Version="$(MicrosoftVisualStudioProjectSystemManagedVSVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.SDK.Tools" Version="$(MicrosoftVisualStudioProjectSystemSDKToolsVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Imaging" Version="$(MicrosoftVisualStudioImagingVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Composition" Version="$(MicrosoftVisualStudioCompositionVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop" Version="$(MicrosoftVisualStudioShellPackagesVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.8.0" Version="$(MicrosoftVisualStudioShellPackagesVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.ServiceHub.Framework" Version="$(MicrosoftServiceHubFrameworkVersion)" PrivateAssets="all" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,24 @@
// 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.VisualStudio.ProjectSystem;
using Microsoft.VisualStudio.ProjectSystem.Properties;
namespace Roslyn.ComponentDebugger
{
internal static class RuleExporter
{
/// <summary>
/// Used to export the XAML rule via MEF
/// </summary>
[ExportPropertyXamlRuleDefinition(
xamlResourceAssemblyName: "Roslyn.ComponentDebugger, Version=" + AssemblyVersion.Version + ", Culture=neutral, PublicKeyToken=31bf3856ad364e35",
xamlResourceStreamName: "XamlRuleToCode:ComponentDebuggerLaunchProfile.xaml",
context: PropertyPageContexts.Project)]
[AppliesTo(Constants.RoslynComponentCapability)]
#pragma warning disable CS0649
public static int LaunchProfileRule;
#pragma warning restore CS0649
}
}

Просмотреть файл

@ -0,0 +1,67 @@
// 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 System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.ComponentModel.Composition;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Build.Framework.XamlTypes;
using Microsoft.VisualStudio.ProjectSystem;
using Microsoft.VisualStudio.ProjectSystem.Properties;
namespace Roslyn.ComponentDebugger
{
[ExportDynamicEnumValuesProvider(nameof(TargetProjectEnumProvider))]
[AppliesTo(Constants.RoslynComponentCapability)]
public class TargetProjectEnumProvider : IDynamicEnumValuesProvider
{
private readonly UnconfiguredProject _unconfiguredProject;
private readonly LaunchSettingsManager _launchSettingsManager;
[ImportingConstructor]
public TargetProjectEnumProvider(UnconfiguredProject unconfiguredProject, LaunchSettingsManager launchSettingsManager)
{
_unconfiguredProject = unconfiguredProject;
_launchSettingsManager = launchSettingsManager;
}
public async Task<IDynamicEnumValuesGenerator> GetProviderAsync(IList<NameValuePair>? options)
{
// get the targets for this project
var projects = await _unconfiguredProject.GetComponentReferencingProjectsAsync().ConfigureAwait(false);
// convert to display values of friendly name + relative path
var displayValues = projects.Select(p => (Path.GetFileNameWithoutExtension(p.FullPath), _unconfiguredProject.MakeRelative(p.FullPath))).ToImmutableArray();
return new TargetProjectEnumValuesGenerator(displayValues);
}
private class TargetProjectEnumValuesGenerator : IDynamicEnumValuesGenerator
{
private readonly ImmutableArray<(string display, string path)> _referencingProjects;
public bool AllowCustomValues => false;
public TargetProjectEnumValuesGenerator(ImmutableArray<(string display, string path)> referencingProjects)
{
_referencingProjects = referencingProjects;
}
public Task<ICollection<IEnumValue>> GetListedValuesAsync()
{
var values = _referencingProjects.Select(p => new PageEnumValue(new EnumValue() { DisplayName = p.display, Name = p.path})).Cast<IEnumValue>().ToImmutableArray();
return Task.FromResult<ICollection<IEnumValue>>(values);
}
/// <summary>
/// The user can't add arbitrary projects from the UI, so this is unsupported
/// </summary>
public Task<IEnumValue?> TryCreateEnumValueAsync(string userSuppliedValue) => Task.FromResult<IEnumValue?>(null);
}
}
}

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="cs" original="../ComponentDebuggerLaunchProfile.xaml">
<body>
<trans-unit id="DynamicEnumProperty|targetProject|Description">
<source>A project that uses this component, whose compilation will be debugged.</source>
<target state="translated">Projekt, který používá tuto komponentu, jejíž kompilace se bude ladit.</target>
<note />
</trans-unit>
<trans-unit id="DynamicEnumProperty|targetProject|DisplayName">
<source>Target Project</source>
<target state="translated">Cílový projekt</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|Description">
<source>Allows a user to debug a Roslyn Component by running it in the context of another projects build.</source>
<target state="translated">Umožňuje uživateli ladit komponentu Roslyn spuštěním v kontextu sestavení jiného projektu.</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|DisplayName">
<source>Roslyn Component</source>
<target state="translated">Komponenta Roslyn</target>
<note />
</trans-unit>
<trans-unit id="StringProperty|Description|Description">
<source>A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list.</source>
<target state="translated">Komponentu Roslyn je možné ladit v kontextu kompilace druhého projektu, který ji používá. Ujistěte se, že cílový projekt odkazuje na tuto komponentu, aby se zobrazila v seznamu.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="de" original="../ComponentDebuggerLaunchProfile.xaml">
<body>
<trans-unit id="DynamicEnumProperty|targetProject|Description">
<source>A project that uses this component, whose compilation will be debugged.</source>
<target state="translated">Ein Projekt, das diese Komponente verwendet, deren Kompilierung debuggt wird.</target>
<note />
</trans-unit>
<trans-unit id="DynamicEnumProperty|targetProject|DisplayName">
<source>Target Project</source>
<target state="translated">Zielprojekt</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|Description">
<source>Allows a user to debug a Roslyn Component by running it in the context of another projects build.</source>
<target state="translated">Ermöglicht einem Benutzer das Debuggen einer Roslyn-Komponente, indem er sie im Kontext eines anderen Projektbuilds ausführt.</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|DisplayName">
<source>Roslyn Component</source>
<target state="translated">Roslyn-Komponente</target>
<note />
</trans-unit>
<trans-unit id="StringProperty|Description|Description">
<source>A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list.</source>
<target state="translated">Eine Roslyn-Komponente kann im Kontext der Kompilierung eines zweiten Projekts, das sie verwendet, debuggt werden. Stellen Sie sicher, dass Ihr Zielprojekt auf diese Komponente verweist, damit sie in der Liste angezeigt wird.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="es" original="../ComponentDebuggerLaunchProfile.xaml">
<body>
<trans-unit id="DynamicEnumProperty|targetProject|Description">
<source>A project that uses this component, whose compilation will be debugged.</source>
<target state="translated">Proyecto que usa este componente, cuya compilación se depurará.</target>
<note />
</trans-unit>
<trans-unit id="DynamicEnumProperty|targetProject|DisplayName">
<source>Target Project</source>
<target state="translated">Proyecto de destino</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|Description">
<source>Allows a user to debug a Roslyn Component by running it in the context of another projects build.</source>
<target state="translated">Permite a un usuario depurar un componente de Roslyn ejecutándolo en el contexto de otra compilación de proyectos.</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|DisplayName">
<source>Roslyn Component</source>
<target state="translated">Componente Roslyn</target>
<note />
</trans-unit>
<trans-unit id="StringProperty|Description|Description">
<source>A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list.</source>
<target state="translated">Un componente Roslyn se puede depurar en el contexto de compilar un segundo proyecto que lo use. Asegúrese de que el proyecto de destino hace referencia a este componente para que aparezca en la lista.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="fr" original="../ComponentDebuggerLaunchProfile.xaml">
<body>
<trans-unit id="DynamicEnumProperty|targetProject|Description">
<source>A project that uses this component, whose compilation will be debugged.</source>
<target state="translated">Projet qui utilise ce composant, dont la compilation sera déboguée.</target>
<note />
</trans-unit>
<trans-unit id="DynamicEnumProperty|targetProject|DisplayName">
<source>Target Project</source>
<target state="translated">Projet cible</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|Description">
<source>Allows a user to debug a Roslyn Component by running it in the context of another projects build.</source>
<target state="translated">Permet à un utilisateur de déboguer un composant Roslyn en lexécutant dans le contexte dun autre Build de projets.</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|DisplayName">
<source>Roslyn Component</source>
<target state="translated">Composant Roslyn</target>
<note />
</trans-unit>
<trans-unit id="StringProperty|Description|Description">
<source>A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list.</source>
<target state="translated">Un composant Roslyn peut être débogué dans le contexte de la compilation d'un second projet qui l'utilise. Assurez-vous que votre projet cible fait référence à ce composant pour qu'il apparaisse dans la liste.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="it" original="../ComponentDebuggerLaunchProfile.xaml">
<body>
<trans-unit id="DynamicEnumProperty|targetProject|Description">
<source>A project that uses this component, whose compilation will be debugged.</source>
<target state="translated">Progetto che usa questo componente, di cui verrà eseguito il debug della compilazione.</target>
<note />
</trans-unit>
<trans-unit id="DynamicEnumProperty|targetProject|DisplayName">
<source>Target Project</source>
<target state="translated">Progetto di destinazione</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|Description">
<source>Allows a user to debug a Roslyn Component by running it in the context of another projects build.</source>
<target state="translated">Consente a un utente di eseguire il debug di un componente Roslyn eseguendolo nel contesto di un'altra compilazione di progetti.</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|DisplayName">
<source>Roslyn Component</source>
<target state="translated">Componente Roslyn</target>
<note />
</trans-unit>
<trans-unit id="StringProperty|Description|Description">
<source>A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list.</source>
<target state="translated">È possibile eseguire il debug di un componente Roslyn nel contesto della compilazione di un secondo progetto in cui viene usato. Assicurarsi che il progetto di destinazione faccia riferimento a questo componente per consentirne la visualizzazione nell'elenco.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ja" original="../ComponentDebuggerLaunchProfile.xaml">
<body>
<trans-unit id="DynamicEnumProperty|targetProject|Description">
<source>A project that uses this component, whose compilation will be debugged.</source>
<target state="translated">コンパイルがデバッグされる、このコンポーネントを使用するプロジェクト。</target>
<note />
</trans-unit>
<trans-unit id="DynamicEnumProperty|targetProject|DisplayName">
<source>Target Project</source>
<target state="translated">ターゲット プロジェクト</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|Description">
<source>Allows a user to debug a Roslyn Component by running it in the context of another projects build.</source>
<target state="translated">ユーザーが Roslyn コンポーネントを別のプロジェクト ビルドのコンテキストで実行してデバッグできるようにします。</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|DisplayName">
<source>Roslyn Component</source>
<target state="translated">Roslyn コンポーネント</target>
<note />
</trans-unit>
<trans-unit id="StringProperty|Description|Description">
<source>A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list.</source>
<target state="translated">Roslyn コンポーネントは、それを使用する 2 番目のプロジェクトのコンパイルのコンテキストでデバッグできます。リストに表示されるようにするには、ターゲットプロジェクトがこのコンポーネントを参照していることを確認してください。</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ko" original="../ComponentDebuggerLaunchProfile.xaml">
<body>
<trans-unit id="DynamicEnumProperty|targetProject|Description">
<source>A project that uses this component, whose compilation will be debugged.</source>
<target state="translated">컴파일이 디버깅될 이 구성 요소를 사용하는 프로젝트입니다.</target>
<note />
</trans-unit>
<trans-unit id="DynamicEnumProperty|targetProject|DisplayName">
<source>Target Project</source>
<target state="translated">대상 프로젝트</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|Description">
<source>Allows a user to debug a Roslyn Component by running it in the context of another projects build.</source>
<target state="translated">사용자가 다른 프로젝트 빌드의 컨텍스트에서 Roslyn 구성 요소를 실행하여 디버그할 수 있습니다.</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|DisplayName">
<source>Roslyn Component</source>
<target state="translated">Roslyn 구성 요소</target>
<note />
</trans-unit>
<trans-unit id="StringProperty|Description|Description">
<source>A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list.</source>
<target state="translated">Roslyn 구성 요소를 사용하는 두 번째 프로젝트를 컴파일하는 맥락에서 Roslyn 구성 요소를 디버깅할 수 있습니다. 대상 프로젝트가 목록에 나타나도록 이 구성요소를 참조하는지 확인하세요.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pl" original="../ComponentDebuggerLaunchProfile.xaml">
<body>
<trans-unit id="DynamicEnumProperty|targetProject|Description">
<source>A project that uses this component, whose compilation will be debugged.</source>
<target state="translated">Projekt korzystający z tego składnika, którego kompilacja zostanie zdebugowana.</target>
<note />
</trans-unit>
<trans-unit id="DynamicEnumProperty|targetProject|DisplayName">
<source>Target Project</source>
<target state="translated">Projekt docelowy</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|Description">
<source>Allows a user to debug a Roslyn Component by running it in the context of another projects build.</source>
<target state="translated">Umożliwia użytkownikowi debugowanie składnika Roslyn poprzez uruchomienie go w kontekście innego kompilacji projektów.</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|DisplayName">
<source>Roslyn Component</source>
<target state="translated">Składnik Roslyn</target>
<note />
</trans-unit>
<trans-unit id="StringProperty|Description|Description">
<source>A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list.</source>
<target state="translated">Składnik Roslyn można debugować w kontekście kompilowania drugiego projektu, który go używa. Upewnij się, że projekt docelowy odwołuje się do tego składnika, aby pojawił się na liście.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pt-BR" original="../ComponentDebuggerLaunchProfile.xaml">
<body>
<trans-unit id="DynamicEnumProperty|targetProject|Description">
<source>A project that uses this component, whose compilation will be debugged.</source>
<target state="translated">Um projeto que utiliza este componente, cuja compilação será depurada.</target>
<note />
</trans-unit>
<trans-unit id="DynamicEnumProperty|targetProject|DisplayName">
<source>Target Project</source>
<target state="translated">Projeto de Destino</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|Description">
<source>Allows a user to debug a Roslyn Component by running it in the context of another projects build.</source>
<target state="translated">Permite que um usuário depure um componente Roslyn, executando-o no contexto de construção de outro projeto.</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|DisplayName">
<source>Roslyn Component</source>
<target state="translated">Componente Roslyn</target>
<note />
</trans-unit>
<trans-unit id="StringProperty|Description|Description">
<source>A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list.</source>
<target state="translated">Um componente Roslyn pode ser depurado no contexto da compilação de um segundo projeto que o utiliza. Certifique-se de que seu projeto de destino está referenciando este componente para que ele apareça na lista.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ru" original="../ComponentDebuggerLaunchProfile.xaml">
<body>
<trans-unit id="DynamicEnumProperty|targetProject|Description">
<source>A project that uses this component, whose compilation will be debugged.</source>
<target state="translated">Проект, использующий этот компонент. При компиляции этого проекта будет проведена отладка.</target>
<note />
</trans-unit>
<trans-unit id="DynamicEnumProperty|targetProject|DisplayName">
<source>Target Project</source>
<target state="translated">Целевой проект</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|Description">
<source>Allows a user to debug a Roslyn Component by running it in the context of another projects build.</source>
<target state="translated">Дает пользователю возможность отлаживать компонент Roslyn, запуская его в контексте сборки другого проекта.</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|DisplayName">
<source>Roslyn Component</source>
<target state="translated">Компонент Roslyn</target>
<note />
</trans-unit>
<trans-unit id="StringProperty|Description|Description">
<source>A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list.</source>
<target state="translated">Можно отлаживать компонент Roslyn в контексте компиляции другого проекта, который использует этот компонент. Чтобы этот компонент отображался в списке, убедитесь, что целевой проект ссылается на этот компонент.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="tr" original="../ComponentDebuggerLaunchProfile.xaml">
<body>
<trans-unit id="DynamicEnumProperty|targetProject|Description">
<source>A project that uses this component, whose compilation will be debugged.</source>
<target state="translated">Bu bileşeni kullanan ve derlemesinde hata ayıklanacak olan proje.</target>
<note />
</trans-unit>
<trans-unit id="DynamicEnumProperty|targetProject|DisplayName">
<source>Target Project</source>
<target state="translated">Hedef Proje</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|Description">
<source>Allows a user to debug a Roslyn Component by running it in the context of another projects build.</source>
<target state="translated">Kullanıcının bir Roslyn Bileşeninde bu bileşeni çalıştırarak derlenen diğer projeler bağlamında hata ayıklamasına olanak sağlar.</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|DisplayName">
<source>Roslyn Component</source>
<target state="translated">Roslyn Bileşeni</target>
<note />
</trans-unit>
<trans-unit id="StringProperty|Description|Description">
<source>A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list.</source>
<target state="translated">Bir Roslyn Bileşeninde bu bileşeni kullanan ikinci bir projenin derlenmesi bağlamında hata ayıklanabilir. Hedef projenizin listede görünmesi için hedef projenin bu bileşene başvurduğundan emin olun.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="zh-Hans" original="../ComponentDebuggerLaunchProfile.xaml">
<body>
<trans-unit id="DynamicEnumProperty|targetProject|Description">
<source>A project that uses this component, whose compilation will be debugged.</source>
<target state="translated">将调试使用此组件的项目的编译。</target>
<note />
</trans-unit>
<trans-unit id="DynamicEnumProperty|targetProject|DisplayName">
<source>Target Project</source>
<target state="translated">目标项目</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|Description">
<source>Allows a user to debug a Roslyn Component by running it in the context of another projects build.</source>
<target state="translated">允许用户通过在另一个项目生成上下文中运行 Roslyn 组件来调试它。</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|DisplayName">
<source>Roslyn Component</source>
<target state="translated">Roslyn 组件</target>
<note />
</trans-unit>
<trans-unit id="StringProperty|Description|Description">
<source>A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list.</source>
<target state="translated">可在编译使用它的第二个项目的上下文中调试 Roslyn 组件。请确保目标项目引用此组件,以使其显示在列表中。</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="zh-Hant" original="../ComponentDebuggerLaunchProfile.xaml">
<body>
<trans-unit id="DynamicEnumProperty|targetProject|Description">
<source>A project that uses this component, whose compilation will be debugged.</source>
<target state="translated">使用此元件的專案,將對其編譯進行偵錯。</target>
<note />
</trans-unit>
<trans-unit id="DynamicEnumProperty|targetProject|DisplayName">
<source>Target Project</source>
<target state="translated">目標專案</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|Description">
<source>Allows a user to debug a Roslyn Component by running it in the context of another projects build.</source>
<target state="translated">允許使用者在組建另一個專案的內容中執行 Roslyn 元件以進行偵錯。</target>
<note />
</trans-unit>
<trans-unit id="Rule|ComponentDebuggerLaunchProfile|DisplayName">
<source>Roslyn Component</source>
<target state="translated">Roslyn 元件</target>
<note />
</trans-unit>
<trans-unit id="StringProperty|Description|Description">
<source>A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list.</source>
<target state="translated">Roslyn 元件可在編譯使用它的第二個專案的內容中進行偵錯。請確認您的目標專案正在參考這個元件,以讓它顯示在清單中。</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

Просмотреть файл

@ -10,15 +10,15 @@
<PackageReference Include="Microsoft.ServiceHub.Framework" Version="$(MicrosoftServiceHubFrameworkVersion)" />
<PackageReference Include="Microsoft.VisualStudio.SDK.Analyzers" Version="$(MicrosoftVisualStudioSDKAnalyzersVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Shell.15.0" Version="$(MicrosoftVisualStudioShell150Version)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime" Version="$(MicrosoftVisualStudioShellInterop140DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime" Version="$(MicrosoftVisualStudioShellInterop153DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime" Version="$(MicrosoftVisualStudioShellInterop156DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.9.0" Version="$(MicrosoftVisualStudioShellInterop90Version)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop" Version="$(MicrosoftVisualStudioShellInteropVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="$(MicrosoftVisualStudioThreadingVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Utilities.Internal" Version="$(MicrosoftVisualStudioUtilitiesInternalVersion)" />
<PackageReference Include="VSLangProj" Version="$(VSLangProjVersion)" />
<PackageReference Include="StreamJsonRpc" Version="$(StreamJsonRpcVersion)" />
<PackageReference Include="VSSDK.TemplateWizardInterface" Version="$(VSSDKTemplateWizardInterfaceVersion)" />
<PackageReference Include="Microsoft.VisualStudio.TemplateWizardInterface" Version="$(MicrosoftVisualStudioTemplateWizardInterfaceVersion)" />
<PackageReference Include="Microsoft.Visualstudio.Validation" Version="$(MicrosoftVisualStudioValidationVersion)" />
<!-- Explicit reference to avoid missing package warning -->
<PackageReference Include="VSLangProj" Version="$(VSLangProjVersion)" />
</ItemGroup>
</Project>

Просмотреть файл

@ -5,3 +5,4 @@
using Microsoft.VisualStudio.Shell;
[assembly: ProvideBindingRedirection(CodeBase = "Roslyn.SDK.Template.Wizard.dll", OldVersionLowerBound = "1.0.0.0")]
[assembly: ProvideCodeBase(AssemblyName = "Roslyn.ComponentDebugger", CodeBase = "$PackageFolder$\\Roslyn.ComponentDebugger.dll")]

Просмотреть файл

@ -11,6 +11,7 @@
<DeployProjectOutput>false</DeployProjectOutput>
<!-- VS Insertion -->
<VisualStudioInsertionComponent>Microsoft.CodeAnalysis.SDK</VisualStudioInsertionComponent>
<SetupProductArch>Neutral</SetupProductArch>
<Ngen>false</Ngen>
</PropertyGroup>
<ItemGroup>
@ -123,13 +124,16 @@
</ProjectReference>
<ProjectReference Include="..\ComponentDebugger\Roslyn.ComponentDebugger.csproj">
<Name>Roslyn.ComponentDebugger</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup%3b</IncludeOutputGroupsInVSIXLocalOnly>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
<ForceIncludeInVSIX>true</ForceIncludeInVSIX>
<Ngen>false</Ngen>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="5.0.0" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="$(SystemThreadingTasksDataflowVersion)" />
<!-- Explicit reference to avoid missing package warning -->
<PackageReference Include="Microsoft.VisualStudio.Interop" Version="$(MicrosoftVisualStudioInteropVersion)" />
<PackageReference Include="VSLangProj" Version="$(VSLangProjVersion)" />
</ItemGroup>
</Project>

Просмотреть файл

@ -22,10 +22,7 @@
<PackageReference Include="Microsoft.VisualStudio.Language.StandardClassification" Version="$(MicrosoftVisualStudioLanguageStandardClassificationVersion)" />
<PackageReference Include="Microsoft.VisualStudio.SDK.Analyzers" Version="$(MicrosoftVisualStudioSDKAnalyzersVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Shell.15.0" Version="$(MicrosoftVisualStudioShell150Version)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime" Version="$(MicrosoftVisualStudioShellInterop140DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime" Version="$(MicrosoftVisualStudioShellInterop153DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime" Version="$(MicrosoftVisualStudioShellInterop156DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.9.0" Version="$(MicrosoftVisualStudioShellInterop90Version)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop" Version="$(MicrosoftVisualStudioShellInteropVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Text.UI.Wpf" Version="$(MicrosoftVisualStudioTextUIWpfVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="$(MicrosoftVisualStudioThreadingVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Utilities.Internal" Version="$(MicrosoftVisualStudioUtilitiesInternalVersion)" />

Просмотреть файл

@ -15,6 +15,7 @@
<VisualStudioInsertionComponent>Roslyn.SyntaxVisualizer.Extension</VisualStudioInsertionComponent>
<Ngen>false</Ngen>
<UseCodeBase>true</UseCodeBase>
<SetupProductArch>Neutral</SetupProductArch>
</PropertyGroup>
<!-- References -->
@ -35,18 +36,15 @@
<PackageReference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" Version="$(MicrosoftVisualStudioImagingInterop140DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.SDK.Analyzers" Version="$(MicrosoftVisualStudioSDKAnalyzersVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Shell.15.0" Version="$(MicrosoftVisualStudioShell150Version)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.10.0" Version="$(MicrosoftVisualStudioShellInterop100Version)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.11.0" Version="$(MicrosoftVisualStudioShellInterop110Version)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime" Version="$(MicrosoftVisualStudioShellInterop140DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime" Version="$(MicrosoftVisualStudioShellInterop153DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime" Version="$(MicrosoftVisualStudioShellInterop156DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.9.0" Version="$(MicrosoftVisualStudioShellInterop90Version)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop" Version="$(MicrosoftVisualStudioShellInteropVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Text.Data" Version="$(MicrosoftVisualStudioTextDataVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Text.Logic" Version="$(MicrosoftVisualStudioTextLogicVersion)" />
<PackageReference Include="Microsoft.VisualStudio.TextManager.Interop.8.0" Version="$(MicrosoftVisualStudioTextManagerInterop80Version)" />
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="$(MicrosoftVisualStudioThreadingVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Utilities.Internal" Version="$(MicrosoftVisualStudioUtilitiesInternalVersion)" />
<PackageReference Include="StreamJsonRpc" Version="$(StreamJsonRpcVersion)" />
<!-- Explicit reference to avoid missing package warning -->
<PackageReference Include="Microsoft.VisualStudio.Interop" Version="$(MicrosoftVisualStudioInteropVersion)" />
</ItemGroup>
<!-- Project References -->

Просмотреть файл

@ -60,6 +60,7 @@
<PackageReference Include="StyleCop.Analyzers" Version="$(StyleCopAnalyzersVersion)" PrivateAssets="all" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)..\..\stylecop.json" Link="stylecop.json" />
<None Include="$(CodeAnalysisRuleSet)" Condition="'$(CodeAnalysisRuleSet)' != ''" Link="%(Filename)%(Extension)" />
<PackageReference Include="System.Net.Http" Version="$(SystemNetHttpVersion)" PrivateAssets="all" ExcludeAssets="all" />
</ItemGroup>
</Project>

Просмотреть файл

@ -29,6 +29,30 @@ namespace Microsoft.CodeAnalysis.Testing
Assert.NotEmpty(resolved);
}
[Fact]
public async Task ResolveReferenceAssemblies_Net35()
{
var referenceAssemblies = ReferenceAssemblies.NetFramework.Net35.Default;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
}
[Fact]
public async Task ResolveReferenceAssemblies_Net35_WindowsForms()
{
var referenceAssemblies = ReferenceAssemblies.NetFramework.Net35.WindowsForms;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
}
[Fact]
public async Task ResolveReferenceAssemblies_Net35_Wpf()
{
var referenceAssemblies = ReferenceAssemblies.NetFramework.Net35.Wpf;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
}
[Fact]
public async Task ResolveReferenceAssemblies_Net40()
{
@ -430,7 +454,127 @@ namespace Microsoft.CodeAnalysis.Testing
#endif
}
[Fact]
public async Task ResolveReferenceAssemblies_Net60Windows()
{
#if NETCOREAPP1_1 || NET46
Assert.False(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
Assert.ThrowsAny<NotSupportedException>(() => ReferenceAssemblies.Net.Net60Windows);
// Avoid a warning for 'async' operator
await Task.Yield();
#else
Assert.True(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
var referenceAssemblies = ReferenceAssemblies.Net.Net60Windows;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
#endif
}
[Fact]
public async Task ResolveReferenceAssemblies_Net60Android()
{
#if NETCOREAPP1_1 || NET46
Assert.False(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
Assert.ThrowsAny<NotSupportedException>(() => ReferenceAssemblies.Net.Net60Android);
// Avoid a warning for 'async' operator
await Task.Yield();
#else
Assert.True(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
var referenceAssemblies = ReferenceAssemblies.Net.Net60Android;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
#endif
}
[Fact]
public async Task ResolveReferenceAssemblies_Net60iOS()
{
#if NETCOREAPP1_1 || NET46
Assert.False(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
Assert.ThrowsAny<NotSupportedException>(() => ReferenceAssemblies.Net.Net60iOS);
// Avoid a warning for 'async' operator
await Task.Yield();
#else
Assert.True(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
var referenceAssemblies = ReferenceAssemblies.Net.Net60iOS;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
#endif
}
[Fact]
public async Task ResolveReferenceAssemblies_Net60MacOS()
{
#if NETCOREAPP1_1 || NET46
Assert.False(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
Assert.ThrowsAny<NotSupportedException>(() => ReferenceAssemblies.Net.Net60MacOS);
// Avoid a warning for 'async' operator
await Task.Yield();
#else
Assert.True(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
var referenceAssemblies = ReferenceAssemblies.Net.Net60MacOS;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
#endif
}
[Fact]
public async Task ResolveReferenceAssemblies_Net60MacCatalyst()
{
#if NETCOREAPP1_1 || NET46
Assert.False(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
Assert.ThrowsAny<NotSupportedException>(() => ReferenceAssemblies.Net.Net60MacCatalyst);
// Avoid a warning for 'async' operator
await Task.Yield();
#else
Assert.True(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
var referenceAssemblies = ReferenceAssemblies.Net.Net60MacCatalyst;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
#endif
}
[Fact]
public async Task ResolveReferenceAssemblies_Net60TvOS()
{
#if NETCOREAPP1_1 || NET46
Assert.False(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
Assert.ThrowsAny<NotSupportedException>(() => ReferenceAssemblies.Net.Net60TvOS);
// Avoid a warning for 'async' operator
await Task.Yield();
#else
Assert.True(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
var referenceAssemblies = ReferenceAssemblies.Net.Net60TvOS;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
#endif
}
[Fact]
public async Task ResolveReferenceAssemblies_Net60()
{
#if NETCOREAPP1_1 || NET46
Assert.False(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
Assert.ThrowsAny<NotSupportedException>(() => ReferenceAssemblies.Net.Net60);
// Avoid a warning for 'async' operator
await Task.Yield();
#else
Assert.True(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
var referenceAssemblies = ReferenceAssemblies.Net.Net60;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
#endif
}
[Theory]
[InlineData("net35")]
[InlineData("net40")]
[InlineData("net45")]
[InlineData("net451")]
@ -450,6 +594,13 @@ namespace Microsoft.CodeAnalysis.Testing
[InlineData("netcoreapp3.1")]
#if !(NETCOREAPP1_1 || NET46)
[InlineData("net5.0")]
[InlineData("net6.0")]
[InlineData("net6.0-windows")]
[InlineData("net6.0-android")]
[InlineData("net6.0-ios")]
[InlineData("net6.0-macos")]
[InlineData("net6.0-maccatalyst")]
[InlineData("net6.0-tvos")]
#endif
[InlineData("netstandard1.0")]
[InlineData("netstandard1.1")]
@ -482,6 +633,7 @@ class TestClass {
return targetFramework switch
{
"net20" => ReferenceAssemblies.NetFramework.Net20.Default,
"net35" => ReferenceAssemblies.NetFramework.Net35.Default,
"net40" => ReferenceAssemblies.NetFramework.Net40.Default,
"net45" => ReferenceAssemblies.NetFramework.Net45.Default,
"net451" => ReferenceAssemblies.NetFramework.Net451.Default,
@ -500,6 +652,13 @@ class TestClass {
"netcoreapp3.0" => ReferenceAssemblies.NetCore.NetCoreApp30,
"netcoreapp3.1" => ReferenceAssemblies.NetCore.NetCoreApp31,
"net5.0" => ReferenceAssemblies.Net.Net50,
"net6.0" => ReferenceAssemblies.Net.Net60,
"net6.0-windows" => ReferenceAssemblies.Net.Net60Windows,
"net6.0-android" => ReferenceAssemblies.Net.Net60Android,
"net6.0-ios" => ReferenceAssemblies.Net.Net60iOS,
"net6.0-macos" => ReferenceAssemblies.Net.Net60MacOS,
"net6.0-maccatalyst" => ReferenceAssemblies.Net.Net60MacCatalyst,
"net6.0-tvos" => ReferenceAssemblies.Net.Net60TvOS,
"netstandard1.0" => ReferenceAssemblies.NetStandard.NetStandard10,
"netstandard1.1" => ReferenceAssemblies.NetStandard.NetStandard11,
"netstandard1.2" => ReferenceAssemblies.NetStandard.NetStandard12,

Просмотреть файл

@ -25,18 +25,16 @@
<PackageReference Include="Microsoft.VisualStudio.SDK.Analyzers" Version="$(MicrosoftVisualStudioSDKAnalyzersVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Shell.15.0" Version="$(MicrosoftVisualStudioShell150Version)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Framework" Version="$(MicrosoftVisualStudioShellFrameworkVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.12.1.DesignTime" Version="$(MicrosoftVisualStudioShellInterop121DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime" Version="$(MicrosoftVisualStudioShellInterop140DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime" Version="$(MicrosoftVisualStudioShellInterop153DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime" Version="$(MicrosoftVisualStudioShellInterop156DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.15.7.DesignTime" Version="$(MicrosoftVisualStudioShellInterop157DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.9.0" Version="$(MicrosoftVisualStudioShellInterop90Version)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop" Version="$(MicrosoftVisualStudioShellInteropVersion)" />
<PackageReference Include="Microsoft.VisualStudio.TextManager.Interop.8.0" Version="$(MicrosoftVisualStudioTextManagerInterop80Version)" />
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="$(MicrosoftVisualStudioThreadingVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Utilities.Internal" Version="$(MicrosoftVisualStudioUtilitiesInternalVersion)" />
<PackageReference Include="NuGet.SolutionRestoreManager.Interop" Version="$(NuGetSolutionRestoreManagerInteropVersion)" />
<PackageReference Include="StreamJsonRpc" Version="$(StreamJsonRpcVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Extensibility.Testing.Xunit.Legacy" Version="$(MicrosoftVisualStudioExtensibilityTestingXunitLegacyVersion)" />
<!-- Explicit reference to avoid missing package warning -->
<PackageReference Include="Microsoft.VisualStudio.Interop" Version="$(MicrosoftVisualStudioInteropVersion)" />
<PackageReference Include="VSLangProj" Version="$(VSLangProjVersion)" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -10,4 +10,9 @@
<ItemGroup>
<ProjectReference Include="..\..\..\src\VisualStudio.Roslyn.SDK\Roslyn.SDK\Roslyn.SDK.csproj" />
</ItemGroup>
<ItemGroup>
<!-- Explicit reference to avoid missing package warning -->
<PackageReference Include="Microsoft.VisualStudio.Interop" Version="$(MicrosoftVisualStudioInteropVersion)" />
<PackageReference Include="VSLangProj" Version="$(VSLangProjVersion)" />
</ItemGroup>
</Project>