Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverts vs deps2 #48232

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 5 additions & 26 deletions eng/targets/Services.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,12 @@
Note that brokered services must be defined in Microsoft.VisualStudio service namespace in order to be considered first party.
-->
<ItemGroup>
<ServiceHubService Include="roslynCodeAnalysis" ClassName="Microsoft.CodeAnalysis.Remote.CodeAnalysisService" />
<ServiceHubService Include="roslynRemoteHost" ClassName="Microsoft.CodeAnalysis.Remote.RemoteHostService" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.DiagnosticAnalyzer" ClassName="Microsoft.CodeAnalysis.Remote.RemoteDiagnosticAnalyzerService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.SemanticClassification" ClassName="Microsoft.CodeAnalysis.Remote.RemoteSemanticClassificationService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.SemanticClassificationCache" ClassName="Microsoft.CodeAnalysis.Remote.RemoteSemanticClassificationCacheService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.DocumentHighlights" ClassName="Microsoft.CodeAnalysis.Remote.RemoteDocumentHighlightsService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.EncapsulateField" ClassName="Microsoft.CodeAnalysis.Remote.RemoteEncapsulateFieldService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.Renamer" ClassName="Microsoft.CodeAnalysis.Remote.RemoteRenamerService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.ConvertTupleToStructCodeRefactoring" ClassName="Microsoft.CodeAnalysis.Remote.RemoteConvertTupleToStructCodeRefactoringService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.SymbolFinder" ClassName="Microsoft.CodeAnalysis.Remote.RemoteSymbolFinderService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.FindUsages" ClassName="Microsoft.CodeAnalysis.Remote.RemoteFindUsagesService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.NavigateToSearch" ClassName="Microsoft.CodeAnalysis.Remote.RemoteNavigateToSearchService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.MissingImportDiscovery" ClassName="Microsoft.CodeAnalysis.Remote.RemoteMissingImportDiscoveryService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.ExtensionMethodImportCompletion" ClassName="Microsoft.CodeAnalysis.Remote.RemoteExtensionMethodImportCompletionService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.DependentTypeFinder" ClassName="Microsoft.CodeAnalysis.Remote.RemoteDependentTypeFinderService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.GlobalNotificationDelivery" ClassName="Microsoft.CodeAnalysis.Remote.RemoteGlobalNotificationDeliveryService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.CodeLensReferences" ClassName="Microsoft.CodeAnalysis.Remote.RemoteCodeLensReferencesService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.DesignerAttributeDiscovery" ClassName="Microsoft.CodeAnalysis.Remote.RemoteDesignerAttributeDiscoveryService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.ProjectTelemetry" ClassName="Microsoft.CodeAnalysis.Remote.RemoteProjectTelemetryService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.SymbolSearchUpdate" ClassName="Microsoft.CodeAnalysis.Remote.RemoteSymbolSearchUpdateService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.TodoCommentsDiscovery" ClassName="Microsoft.CodeAnalysis.Remote.RemoteTodoCommentsDiscoveryService+Factory" IsBrokered="true" />
<ServiceHubService Include="roslynRemoteDesignerAttributeService" ClassName="Microsoft.CodeAnalysis.Remote.RemoteDesignerAttributeService" />
<ServiceHubService Include="roslynRemoteProjectTelemetryService" ClassName="Microsoft.CodeAnalysis.Remote.RemoteProjectTelemetryService" />
<ServiceHubService Include="roslynRemoteSymbolSearchUpdateEngine" ClassName="Microsoft.CodeAnalysis.Remote.RemoteSymbolSearchUpdateEngine" />
<ServiceHubService Include="roslynRemoteTodoCommentsService" ClassName="Microsoft.CodeAnalysis.Remote.RemoteTodoCommentsService" />
<ServiceHubService Include="roslynLanguageServer" ClassName="Microsoft.CodeAnalysis.Remote.LanguageServer" />
</ItemGroup>

<!--
Roslyn in-proc brokered services.
-->
<ItemGroup>
<InProcService Include="Microsoft.VisualStudio.LanguageServices.SolutionAssetProvider" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,136 +5,114 @@
#nullable enable

using System;
using System.Runtime.Serialization;

namespace Microsoft.CodeAnalysis.Diagnostics.Telemetry
{
/// <summary>
/// Contains telemetry info for a specific analyzer, such as count of registered actions, the total execution time, etc.
/// </summary>
[DataContract]
public sealed class AnalyzerTelemetryInfo
{
/// <summary>
/// Count of registered compilation start actions.
/// </summary>
[DataMember(Order = 0)]
public int CompilationStartActionsCount { get; set; }
public int CompilationStartActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered compilation end actions.
/// </summary>
[DataMember(Order = 1)]
public int CompilationEndActionsCount { get; set; }
public int CompilationEndActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered compilation actions.
/// </summary>
[DataMember(Order = 2)]
public int CompilationActionsCount { get; set; }
public int CompilationActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered syntax tree actions.
/// </summary>
[DataMember(Order = 3)]
public int SyntaxTreeActionsCount { get; set; }
public int SyntaxTreeActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered additional file actions.
/// </summary>
[DataMember(Order = 4)]
public int AdditionalFileActionsCount { get; set; }
public int AdditionalFileActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered semantic model actions.
/// </summary>
[DataMember(Order = 5)]
public int SemanticModelActionsCount { get; set; }
public int SemanticModelActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered symbol actions.
/// </summary>
[DataMember(Order = 6)]
public int SymbolActionsCount { get; set; }
public int SymbolActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered symbol start actions.
/// </summary>
[DataMember(Order = 7)]
public int SymbolStartActionsCount { get; set; }
public int SymbolStartActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered symbol end actions.
/// </summary>
[DataMember(Order = 8)]
public int SymbolEndActionsCount { get; set; }
public int SymbolEndActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered syntax node actions.
/// </summary>
[DataMember(Order = 9)]
public int SyntaxNodeActionsCount { get; set; }
public int SyntaxNodeActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered code block start actions.
/// </summary>
[DataMember(Order = 10)]
public int CodeBlockStartActionsCount { get; set; }
public int CodeBlockStartActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered code block end actions.
/// </summary>
[DataMember(Order = 11)]
public int CodeBlockEndActionsCount { get; set; }
public int CodeBlockEndActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered code block actions.
/// </summary>
[DataMember(Order = 12)]
public int CodeBlockActionsCount { get; set; }
public int CodeBlockActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered operation actions.
/// </summary>
[DataMember(Order = 13)]
public int OperationActionsCount { get; set; }
public int OperationActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered operation block start actions.
/// </summary>
[DataMember(Order = 14)]
public int OperationBlockStartActionsCount { get; set; }
public int OperationBlockStartActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered operation block end actions.
/// </summary>
[DataMember(Order = 15)]
public int OperationBlockEndActionsCount { get; set; }
public int OperationBlockEndActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered operation block actions.
/// </summary>
[DataMember(Order = 16)]
public int OperationBlockActionsCount { get; set; }
public int OperationBlockActionsCount { get; set; } = 0;

/// <summary>
/// Count of registered suppression actions.
/// This is the same as count of <see cref="DiagnosticSuppressor"/>s as each suppressor
/// has a single suppression action, i.e. <see cref="DiagnosticSuppressor.ReportSuppressions(SuppressionAnalysisContext)"/>.
/// </summary>
[DataMember(Order = 17)]
public int SuppressionActionsCount { get; set; }
public int SuppressionActionsCount { get; set; } = 0;

/// <summary>
/// Total execution time.
/// </summary>
[DataMember(Order = 18)]
public TimeSpan ExecutionTime { get; set; } = TimeSpan.Zero;

/// <summary>
/// Gets a value indicating whether the analyzer supports concurrent execution.
/// </summary>
[DataMember(Order = 19)]
public bool Concurrent { get; set; }

internal AnalyzerTelemetryInfo(AnalyzerActionCounts actionCounts, int suppressionActionCounts, TimeSpan executionTime)
Expand Down
4 changes: 0 additions & 4 deletions src/Compilers/Core/Portable/Text/TextChange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.Serialization;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;

Expand All @@ -16,19 +15,16 @@ namespace Microsoft.CodeAnalysis.Text
/// <summary>
/// Describes a single change when a particular span is replaced with a new text.
/// </summary>
[DataContract]
public readonly struct TextChange : IEquatable<TextChange>
{
/// <summary>
/// The original span of the changed text.
/// </summary>
[DataMember(Order = 0)]
public TextSpan Span { get; }

/// <summary>
/// The new text.
/// </summary>
[DataMember(Order = 1)]
public string? NewText { get; }

/// <summary>
Expand Down
4 changes: 0 additions & 4 deletions src/Compilers/Core/Portable/Text/TextSpan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#nullable enable

using System;
using System.Runtime.Serialization;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.Text
Expand All @@ -14,7 +13,6 @@ namespace Microsoft.CodeAnalysis.Text
/// Immutable abstract representation of a span of text. For example, in an error diagnostic that reports a
/// location, it could come from a parsed string, text from a tool editor buffer, etc.
/// </summary>
[DataContract]
public readonly struct TextSpan : IEquatable<TextSpan>, IComparable<TextSpan>
{
/// <summary>
Expand All @@ -40,7 +38,6 @@ public TextSpan(int start, int length)
/// <summary>
/// Start point of the span.
/// </summary>
[DataMember(Order = 0)]
public int Start { get; }

/// <summary>
Expand All @@ -51,7 +48,6 @@ public TextSpan(int start, int length)
/// <summary>
/// Length of the span.
/// </summary>
[DataMember(Order = 1)]
public int Length { get; }

/// <summary>
Expand Down
27 changes: 13 additions & 14 deletions src/EditorFeatures/CSharpTest/AddUsing/AddUsingNuGetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public async Task TestSearchPackageSingleName()

var packageServiceMock = new Mock<ISymbolSearchService>(MockBehavior.Strict);
packageServiceMock.Setup(s => s.FindReferenceAssembliesWithTypeAsync("NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(new ValueTask<ImmutableArray<ReferenceAssemblyWithTypeResult>>(ImmutableArray<ReferenceAssemblyWithTypeResult>.Empty));
.Returns(Task.FromResult<IList<ReferenceAssemblyWithTypeResult>>(new List<ReferenceAssemblyWithTypeResult>()));
packageServiceMock.Setup(s => s.FindPackagesWithTypeAsync(
NugetOrgSource, "NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(CreateSearchResult("NuGetPackage", "NuGetType", CreateNameParts("NuGetNamespace")));
Expand Down Expand Up @@ -93,7 +93,7 @@ public async Task TestSearchPackageMultipleNames()

var packageServiceMock = new Mock<ISymbolSearchService>(MockBehavior.Strict);
packageServiceMock.Setup(s => s.FindReferenceAssembliesWithTypeAsync("NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(new ValueTask<ImmutableArray<ReferenceAssemblyWithTypeResult>>(ImmutableArray<ReferenceAssemblyWithTypeResult>.Empty));
.Returns(Task.FromResult<IList<ReferenceAssemblyWithTypeResult>>(new List<ReferenceAssemblyWithTypeResult>()));
packageServiceMock.Setup(s => s.FindPackagesWithTypeAsync(
NugetOrgSource, "NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(CreateSearchResult("NuGetPackage", "NuGetType", CreateNameParts("NS1", "NS2")));
Expand Down Expand Up @@ -122,7 +122,7 @@ public async Task TestMissingIfPackageAlreadyInstalled()

var packageServiceMock = new Mock<ISymbolSearchService>(MockBehavior.Strict);
packageServiceMock.Setup(s => s.FindReferenceAssembliesWithTypeAsync("NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(new ValueTask<ImmutableArray<ReferenceAssemblyWithTypeResult>>(ImmutableArray<ReferenceAssemblyWithTypeResult>.Empty));
.Returns(Task.FromResult<IList<ReferenceAssemblyWithTypeResult>>(new List<ReferenceAssemblyWithTypeResult>()));
packageServiceMock.Setup(s => s.FindPackagesWithTypeAsync(
NugetOrgSource, "NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(CreateSearchResult("NuGetPackage", "NuGetType", CreateNameParts("NS1", "NS2")));
Expand All @@ -148,7 +148,7 @@ public async Task TestOptionsOffered()

var packageServiceMock = new Mock<ISymbolSearchService>(MockBehavior.Strict);
packageServiceMock.Setup(s => s.FindReferenceAssembliesWithTypeAsync("NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(new ValueTask<ImmutableArray<ReferenceAssemblyWithTypeResult>>(ImmutableArray<ReferenceAssemblyWithTypeResult>.Empty));
.Returns(Task.FromResult<IList<ReferenceAssemblyWithTypeResult>>(new List<ReferenceAssemblyWithTypeResult>()));
packageServiceMock.Setup(s => s.FindPackagesWithTypeAsync(
NugetOrgSource, "NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(CreateSearchResult("NuGetPackage", "NuGetType", CreateNameParts("NS1", "NS2")));
Expand Down Expand Up @@ -192,7 +192,7 @@ public async Task TestInstallGetsCalledNoVersion()

var packageServiceMock = new Mock<ISymbolSearchService>(MockBehavior.Strict);
packageServiceMock.Setup(s => s.FindReferenceAssembliesWithTypeAsync("NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(new ValueTask<ImmutableArray<ReferenceAssemblyWithTypeResult>>(ImmutableArray<ReferenceAssemblyWithTypeResult>.Empty));
.Returns(Task.FromResult<IList<ReferenceAssemblyWithTypeResult>>(new List<ReferenceAssemblyWithTypeResult>()));
packageServiceMock.Setup(s => s.FindPackagesWithTypeAsync(
NugetOrgSource, "NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(CreateSearchResult("NuGetPackage", "NuGetType", CreateNameParts("NuGetNamespace")));
Expand Down Expand Up @@ -226,7 +226,7 @@ public async Task TestInstallGetsCalledWithVersion()

var packageServiceMock = new Mock<ISymbolSearchService>(MockBehavior.Strict);
packageServiceMock.Setup(s => s.FindReferenceAssembliesWithTypeAsync("NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(new ValueTask<ImmutableArray<ReferenceAssemblyWithTypeResult>>(ImmutableArray<ReferenceAssemblyWithTypeResult>.Empty));
.Returns(Task.FromResult<IList<ReferenceAssemblyWithTypeResult>>(new List<ReferenceAssemblyWithTypeResult>()));
packageServiceMock.Setup(s => s.FindPackagesWithTypeAsync(NugetOrgSource, "NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(CreateSearchResult("NuGetPackage", "NuGetType", CreateNameParts("NuGetNamespace")));

Expand Down Expand Up @@ -260,7 +260,7 @@ public async Task TestFailedInstallRollsBackFile()

var packageServiceMock = new Mock<ISymbolSearchService>(MockBehavior.Strict);
packageServiceMock.Setup(s => s.FindReferenceAssembliesWithTypeAsync("NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(new ValueTask<ImmutableArray<ReferenceAssemblyWithTypeResult>>(ImmutableArray<ReferenceAssemblyWithTypeResult>.Empty));
.Returns(Task.FromResult<IList<ReferenceAssemblyWithTypeResult>>(new List<ReferenceAssemblyWithTypeResult>()));
packageServiceMock.Setup(s => s.FindPackagesWithTypeAsync(NugetOrgSource, "NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(CreateSearchResult("NuGetPackage", "NuGetType", CreateNameParts("NuGetNamespace")));

Expand All @@ -276,18 +276,17 @@ await TestInRegularAndScriptAsync(
installerServiceMock.Verify();
}

private static ValueTask<ImmutableArray<PackageWithTypeResult>> CreateSearchResult(
private static Task<IList<PackageWithTypeResult>> CreateSearchResult(
string packageName, string typeName, ImmutableArray<string> containingNamespaceNames)
{
return CreateSearchResult(new PackageWithTypeResult(
packageName: packageName, rank: 0, typeName: typeName,
version: null, containingNamespaceNames: containingNamespaceNames));
packageName: packageName, typeName: typeName, version: null,
rank: 0, containingNamespaceNames: containingNamespaceNames));
}

private static ValueTask<ImmutableArray<PackageWithTypeResult>> CreateSearchResult(params PackageWithTypeResult[] results)
=> new(ImmutableArray.Create(results));
private static Task<IList<PackageWithTypeResult>> CreateSearchResult(params PackageWithTypeResult[] results)
=> Task.FromResult<IList<PackageWithTypeResult>>(ImmutableArray.Create(results));

private static ImmutableArray<string> CreateNameParts(params string[] parts)
=> parts.ToImmutableArray();
private static ImmutableArray<string> CreateNameParts(params string[] parts) => parts.ToImmutableArray();
}
}
Loading