Skip to content

Commit

Permalink
Merge branch 'main-vs-deps' into merges/main-to-main-vs-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeRobich authored May 4, 2021
2 parents dd21600 + 5b2aebf commit 95e20d6
Show file tree
Hide file tree
Showing 186 changed files with 7,314 additions and 560 deletions.
1 change: 1 addition & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
<add key="nuget-build" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/nuget-build/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="vs-buildservices" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" />
Expand Down
7 changes: 7 additions & 0 deletions Roslyn.sln
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Rebu
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Rebuild.UnitTests", "src\Compilers\Core\RebuildTest\Microsoft.CodeAnalysis.Rebuild.UnitTests.csproj", "{21B49277-E55A-45EF-8818-744BCD6CB732}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.DotNetWatch", "src\Tools\ExternalAccess\DotNetWatch\Microsoft.CodeAnalysis.ExternalAccess.DotNetWatch.csproj", "{9DF89AA1-142B-4D83-A9E7-F57BD1DDA333}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests", "src\Tools\ExternalAccess\RazorTest\Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests.csproj", "{BB987FFC-B758-4F73-96A3-923DE8DCFF1A}"
EndProject
Global
Expand Down Expand Up @@ -1268,6 +1270,10 @@ Global
{21B49277-E55A-45EF-8818-744BCD6CB732}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21B49277-E55A-45EF-8818-744BCD6CB732}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21B49277-E55A-45EF-8818-744BCD6CB732}.Release|Any CPU.Build.0 = Release|Any CPU
{9DF89AA1-142B-4D83-A9E7-F57BD1DDA333}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9DF89AA1-142B-4D83-A9E7-F57BD1DDA333}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9DF89AA1-142B-4D83-A9E7-F57BD1DDA333}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9DF89AA1-142B-4D83-A9E7-F57BD1DDA333}.Release|Any CPU.Build.0 = Release|Any CPU
{BB987FFC-B758-4F73-96A3-923DE8DCFF1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BB987FFC-B758-4F73-96A3-923DE8DCFF1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB987FFC-B758-4F73-96A3-923DE8DCFF1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -1494,6 +1500,7 @@ Global
{0C2E1633-1462-4712-88F4-A0C945BAD3A8} = {C2D1346B-9665-4150-B644-075CF1636BAA}
{B7D29559-4360-434A-B9B9-2C0612287999} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9}
{21B49277-E55A-45EF-8818-744BCD6CB732} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9}
{9DF89AA1-142B-4D83-A9E7-F57BD1DDA333} = {8977A560-45C2-4EC2-A849-97335B382C74}
{BB987FFC-B758-4F73-96A3-923DE8DCFF1A} = {8977A560-45C2-4EC2-A849-97335B382C74}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Expand Down
104 changes: 43 additions & 61 deletions eng/Versions.props

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@ function TestUsingRunTests() {
$args += " --tfm net472"
$args += " --retry"
$args += " --sequential"
$args += " --include '\.IntegrationTests'"
# Skip VS integration tests prior to having a build of dev17 available for testing
# $args += " --include '\.IntegrationTests'"
$args += " --include 'Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests'"

if ($lspEditor) {
Expand Down
1 change: 1 addition & 0 deletions eng/targets/Services.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<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="Microsoft.VisualStudio.LanguageServices.EditAndContinue" ClassName="Microsoft.CodeAnalysis.EditAndContinue.RemoteEditAndContinueService+Factory" IsBrokered="true" />
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.InheritanceMargin" ClassName="Microsoft.CodeAnalysis.Remote.RemoteInheritanceMarginService+Factory" IsBrokered="true" />
<ServiceHubService Include="roslynRemoteLanguageServer" ClassName="Microsoft.CodeAnalysis.Remote.RemoteLanguageServer" />
</ItemGroup>

Expand Down
8 changes: 4 additions & 4 deletions src/Compilers/Extension/Roslyn.Compilers.Extension.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,19 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="EnvDTE" Version="$(EnvDTEVersion)" />
<PackageReference Include="Microsoft.ServiceHub.Framework" Version="$(MicrosoftServiceHubFrameworkVersion)" />
<PackageReference Include="Microsoft.VisualStudio.ComponentModelHost" Version="$(MicrosoftVisualStudioComponentModelHostVersion)" />
<PackageReference Include="Microsoft.VisualStudio.CoreUtility" Version="$(MicrosoftVisualStudioCoreUtilityVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" Version="$(MicrosoftVisualStudioImagingInterop140DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Interop" Version="$(MicrosoftVisualStudioInteropVersion)" />
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.Managed" Version="$(MicrosoftVisualStudioProjectSystemManagedVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.15.0" Version="$(MicrosoftVisualStudioShell150Version)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.8.0" Version="$(MicrosoftVisualStudioShellInterop80Version)" />
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.10.0" Version="$(MicrosoftVisualStudioShellInterop100Version)" />
<PackageReference Include="Microsoft.Build" Version="$(MicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkVersion)" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildTasksCoreVersion)" />
<PackageReference Include="Microsoft.VisualStudio.SDK.Analyzers" Version="$(MicrosoftVisualStudioSDKAnalyzersVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="$(MicrosoftVisualStudioThreadingVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Validation" Version="$(MicrosoftVisualStudioValidationVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
<PackageReference Include="Microsoft.ServiceHub.Framework" Version="$(MicrosoftServiceHubFrameworkVersion)" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/Compilers/Test/Core/Traits/Traits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ public static class Features
public const string GoToBase = nameof(GoToBase);
public const string GoToDefinition = nameof(GoToDefinition);
public const string GoToImplementation = nameof(GoToImplementation);
public const string InheritanceMargin = nameof(InheritanceMargin);
public const string InlineHints = nameof(InlineHints);
public const string Interactive = nameof(Interactive);
public const string InteractiveHost = nameof(InteractiveHost);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// 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.Composition;
using System.Linq;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Extensions;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.InheritanceMargin;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.Editor.CSharp.InheritanceMargin
{
[ExportLanguageService(typeof(IInheritanceMarginService), LanguageNames.CSharp), Shared]
internal class CSharpInheritanceMarginService : AbstractInheritanceMarginService
{
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
[ImportingConstructor]
public CSharpInheritanceMarginService()
{
}

protected override ImmutableArray<SyntaxNode> GetMembers(IEnumerable<SyntaxNode> nodesToSearch)
{
var typeDeclarationNodes = nodesToSearch.OfType<TypeDeclarationSyntax>();

using var _ = PooledObjects.ArrayBuilder<SyntaxNode>.GetInstance(out var builder);
foreach (var typeDeclarationNode in typeDeclarationNodes)
{
// 1. Add the type declaration node.(e.g. class, struct etc..)
// Use its identifier's position as the line number, since we want the margin to be placed with the identifier
builder.Add(typeDeclarationNode);

// 2. Add type members inside this type declaration.
foreach (var member in typeDeclarationNode.Members)
{
if (member.IsKind(
SyntaxKind.MethodDeclaration,
SyntaxKind.PropertyDeclaration,
SyntaxKind.EventDeclaration,
SyntaxKind.IndexerDeclaration))
{
builder.Add(member);
}

// For multiple events that declared in the same EventFieldDeclaration,
// add all VariableDeclarators
if (member is EventFieldDeclarationSyntax eventFieldDeclarationNode)
{
builder.AddRange(eventFieldDeclarationNode.Declaration.Variables);
}
}
}

return builder.ToImmutableArray();
}

protected override SyntaxToken GetDeclarationToken(SyntaxNode declarationNode)
=> declarationNode switch
{
MethodDeclarationSyntax methodDeclarationNode => methodDeclarationNode.Identifier,
PropertyDeclarationSyntax propertyDeclarationNode => propertyDeclarationNode.Identifier,
EventDeclarationSyntax eventDeclarationNode => eventDeclarationNode.Identifier,
VariableDeclaratorSyntax variableDeclaratorNode => variableDeclaratorNode.Identifier,
TypeDeclarationSyntax baseTypeDeclarationNode => baseTypeDeclarationNode.Identifier,
IndexerDeclarationSyntax indexerDeclarationNode => indexerDeclarationNode.ThisKeyword,
// Shouldn't reach here since the input declaration nodes are coming from GetMembers() method above
_ => throw ExceptionUtilities.UnexpectedValue(declarationNode),
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="$(MicrosoftVisualStudioThreadingVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Imaging" Version="$(MicrosoftVisualStudioImagingVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" Version="$(MicrosoftVisualStudioImagingInterop140DesignTimeVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Composition" Version="$(MicrosoftVisualStudioCompositionVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Composition" Version="$(MicrosoftVisualStudioCompositionVersion)" />
<PackageReference Include="Microsoft.VisualStudio.ImageCatalog" Version="$(MicrosoftVisualStudioImageCatalogVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Imaging" Version="$(MicrosoftVisualStudioImagingVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" Version="$(MicrosoftVisualStudioImagingInterop140DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Text.Data" Version="$(MicrosoftVisualStudioTextDataVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Text.UI" Version="$(MicrosoftVisualStudioTextUIVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Text.UI.Cocoa" Version="$(MicrosoftVisualStudioTextUICocoaVersion)" />
Expand All @@ -40,6 +42,7 @@
<PackageReference Include="XamarinMac" Version="$(XamarinMacVersion)" />
<PackageReference Include="System.ValueTuple" Version="$(SystemValueTupleVersion)" />
</ItemGroup>

<ItemGroup>
<!--
Mono doesn't support embedded interop types, and this package has a targets file that turns it on for all VS SDK librarys, and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Elfie" Version="$(MicrosoftCodeAnalysisElfieVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Imaging" Version="$(MicrosoftVisualStudioImagingVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" Version="$(MicrosoftVisualStudioImagingInterop140DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.InteractiveWindow" Version="$(MicrosoftVisualStudioInteractiveWindowVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Interop" Version="$(MicrosoftVisualStudioInteropVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Language.NavigateTo.Interfaces" Version="$(MicrosoftVisualStudioLanguageNavigateToInterfacesVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Language.StandardClassification" Version="$(MicrosoftVisualStudioLanguageStandardClassificationVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Language.Intellisense" Version="$(MicrosoftVisualStudioLanguageIntellisenseVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Text.UI.Wpf" Version="$(MicrosoftVisualStudioTextUIWpfVersion)" />
<PackageReference Include="Microsoft.VisualStudio.SDK.EmbedInteropTypes" Version="$(MicrosoftVisualStudioSDKEmbedInteropTypesVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="$(MicrosoftVisualStudioThreadingVersion)" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ public static DefinitionItem ToNonClassifiedDefinitionItem(
options: FindReferencesSearchOptions.Default, cancellationToken: CancellationToken.None).WaitAndGetResult_CanCallOnBackground(CancellationToken.None);
}

public static Task<DefinitionItem> ToNonClassifiedDefinitionItemAsync(
this ISymbol definition,
Solution solution,
bool includeHiddenLocations,
CancellationToken cancellationToken)
{
return ToDefinitionItemAsync(
definition, solution, isPrimary: false, includeHiddenLocations, includeClassifiedSpans: false,
options: FindReferencesSearchOptions.Default.With(unidirectionalHierarchyCascade: true), cancellationToken: cancellationToken);
}

public static Task<DefinitionItem> ToClassifiedDefinitionItemAsync(
this ISymbol definition,
Solution solution,
Expand Down
3 changes: 2 additions & 1 deletion src/EditorFeatures/Core/GoToBase/FindBaseHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public static ValueTask<ImmutableArray<ISymbol>> FindBasesAsync(
namedTypeSymbol.TypeKind == TypeKind.Interface ||
namedTypeSymbol.TypeKind == TypeKind.Struct))
{
return ValueTaskFactory.FromResult(BaseTypeFinder.FindBaseTypesAndInterfaces(namedTypeSymbol));
var result = BaseTypeFinder.FindBaseTypesAndInterfaces(namedTypeSymbol).CastArray<ISymbol>();
return ValueTaskFactory.FromResult(result);
}

if (symbol.Kind == SymbolKind.Property ||
Expand Down
22 changes: 19 additions & 3 deletions src/EditorFeatures/Core/GoToDefinition/GoToDefinitionHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ public static ImmutableArray<DefinitionItem> GetDefinitions(
//
// Passing along the classified information is valuable for OOP scenarios where we want
// all that expensive computation done on the OOP side and not in the VS side.
//
//
// However, Go To Definition is all in-process, and is also synchronous. So we do not
// want to fetch the classifications here. It slows down the command and leads to a
// want to fetch the classifications here. It slows down the command and leads to a
// measurable delay in our perf tests.
//
//
// So, if we only have a single location to go to, this does no unnecessary work. And,
// if we do have multiple locations to show, it will just be done in the BG, unblocking
// this command thread so it can return the user faster.
Expand Down Expand Up @@ -129,5 +129,21 @@ public static bool TryGoToDefinition(
streamingPresenter.TryNavigateToOrPresentItemsAsync(
threadingContext, solution.Workspace, title, definitions, cancellationToken));
}

public static bool TryGoToDefinition(
ImmutableArray<DefinitionItem> definitions,
Workspace workspace,
string title,
IThreadingContext threadingContext,
IStreamingFindUsagesPresenter streamingPresenter,
CancellationToken cancellationToken)
{
if (definitions.IsDefaultOrEmpty)
return false;

return threadingContext.JoinableTaskFactory.Run(() =>
streamingPresenter.TryNavigateToOrPresentItemsAsync(
threadingContext, workspace, title, definitions, cancellationToken));
}
}
}
Loading

0 comments on commit 95e20d6

Please sign in to comment.