Skip to content

Commit 95e20d6

Browse files
authored
Merge branch 'main-vs-deps' into merges/main-to-main-vs-deps
2 parents dd21600 + 5b2aebf commit 95e20d6

File tree

186 files changed

+7314
-560
lines changed

Some content is hidden

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

186 files changed

+7314
-560
lines changed

NuGet.config

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
99
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
1010
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
11+
<add key="nuget-build" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/nuget-build/nuget/v3/index.json" />
1112
<add key="vssdk" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json" />
1213
<add key="vs-impl" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json" />
1314
<add key="vs-buildservices" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" />

Roslyn.sln

+7
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Rebu
487487
EndProject
488488
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Rebuild.UnitTests", "src\Compilers\Core\RebuildTest\Microsoft.CodeAnalysis.Rebuild.UnitTests.csproj", "{21B49277-E55A-45EF-8818-744BCD6CB732}"
489489
EndProject
490+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.DotNetWatch", "src\Tools\ExternalAccess\DotNetWatch\Microsoft.CodeAnalysis.ExternalAccess.DotNetWatch.csproj", "{9DF89AA1-142B-4D83-A9E7-F57BD1DDA333}"
491+
EndProject
490492
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}"
491493
EndProject
492494
Global
@@ -1268,6 +1270,10 @@ Global
12681270
{21B49277-E55A-45EF-8818-744BCD6CB732}.Debug|Any CPU.Build.0 = Debug|Any CPU
12691271
{21B49277-E55A-45EF-8818-744BCD6CB732}.Release|Any CPU.ActiveCfg = Release|Any CPU
12701272
{21B49277-E55A-45EF-8818-744BCD6CB732}.Release|Any CPU.Build.0 = Release|Any CPU
1273+
{9DF89AA1-142B-4D83-A9E7-F57BD1DDA333}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1274+
{9DF89AA1-142B-4D83-A9E7-F57BD1DDA333}.Debug|Any CPU.Build.0 = Debug|Any CPU
1275+
{9DF89AA1-142B-4D83-A9E7-F57BD1DDA333}.Release|Any CPU.ActiveCfg = Release|Any CPU
1276+
{9DF89AA1-142B-4D83-A9E7-F57BD1DDA333}.Release|Any CPU.Build.0 = Release|Any CPU
12711277
{BB987FFC-B758-4F73-96A3-923DE8DCFF1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12721278
{BB987FFC-B758-4F73-96A3-923DE8DCFF1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
12731279
{BB987FFC-B758-4F73-96A3-923DE8DCFF1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1494,6 +1500,7 @@ Global
14941500
{0C2E1633-1462-4712-88F4-A0C945BAD3A8} = {C2D1346B-9665-4150-B644-075CF1636BAA}
14951501
{B7D29559-4360-434A-B9B9-2C0612287999} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9}
14961502
{21B49277-E55A-45EF-8818-744BCD6CB732} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9}
1503+
{9DF89AA1-142B-4D83-A9E7-F57BD1DDA333} = {8977A560-45C2-4EC2-A849-97335B382C74}
14971504
{BB987FFC-B758-4F73-96A3-923DE8DCFF1A} = {8977A560-45C2-4EC2-A849-97335B382C74}
14981505
EndGlobalSection
14991506
GlobalSection(ExtensibilityGlobals) = postSolution

eng/Versions.props

+43-61
Large diffs are not rendered by default.

eng/build.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,8 @@ function TestUsingRunTests() {
413413
$args += " --tfm net472"
414414
$args += " --retry"
415415
$args += " --sequential"
416-
$args += " --include '\.IntegrationTests'"
416+
# Skip VS integration tests prior to having a build of dev17 available for testing
417+
# $args += " --include '\.IntegrationTests'"
417418
$args += " --include 'Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests'"
418419

419420
if ($lspEditor) {

eng/targets/Services.props

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.SymbolSearchUpdate" ClassName="Microsoft.CodeAnalysis.Remote.RemoteSymbolSearchUpdateService+Factory" IsBrokered="true" />
3636
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.TodoCommentsDiscovery" ClassName="Microsoft.CodeAnalysis.Remote.RemoteTodoCommentsDiscoveryService+Factory" IsBrokered="true" />
3737
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.EditAndContinue" ClassName="Microsoft.CodeAnalysis.EditAndContinue.RemoteEditAndContinueService+Factory" IsBrokered="true" />
38+
<ServiceHubService Include="Microsoft.VisualStudio.LanguageServices.InheritanceMargin" ClassName="Microsoft.CodeAnalysis.Remote.RemoteInheritanceMarginService+Factory" IsBrokered="true" />
3839
<ServiceHubService Include="roslynRemoteLanguageServer" ClassName="Microsoft.CodeAnalysis.Remote.RemoteLanguageServer" />
3940
</ItemGroup>
4041

src/Compilers/Extension/Roslyn.Compilers.Extension.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,19 @@
108108
</ProjectReference>
109109
</ItemGroup>
110110
<ItemGroup>
111-
<PackageReference Include="EnvDTE" Version="$(EnvDTEVersion)" />
112111
<PackageReference Include="Microsoft.ServiceHub.Framework" Version="$(MicrosoftServiceHubFrameworkVersion)" />
112+
<PackageReference Include="Microsoft.VisualStudio.ComponentModelHost" Version="$(MicrosoftVisualStudioComponentModelHostVersion)" />
113+
<PackageReference Include="Microsoft.VisualStudio.CoreUtility" Version="$(MicrosoftVisualStudioCoreUtilityVersion)" />
114+
<PackageReference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" Version="$(MicrosoftVisualStudioImagingInterop140DesignTimeVersion)" />
115+
<PackageReference Include="Microsoft.VisualStudio.Interop" Version="$(MicrosoftVisualStudioInteropVersion)" />
113116
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.Managed" Version="$(MicrosoftVisualStudioProjectSystemManagedVersion)" />
114117
<PackageReference Include="Microsoft.VisualStudio.Shell.15.0" Version="$(MicrosoftVisualStudioShell150Version)" />
115-
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.8.0" Version="$(MicrosoftVisualStudioShellInterop80Version)" />
116-
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.10.0" Version="$(MicrosoftVisualStudioShellInterop100Version)" />
117118
<PackageReference Include="Microsoft.Build" Version="$(MicrosoftBuildVersion)" />
118119
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkVersion)" />
119120
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildTasksCoreVersion)" />
120121
<PackageReference Include="Microsoft.VisualStudio.SDK.Analyzers" Version="$(MicrosoftVisualStudioSDKAnalyzersVersion)" PrivateAssets="all" />
121122
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="$(MicrosoftVisualStudioThreadingVersion)" />
122123
<PackageReference Include="Microsoft.VisualStudio.Validation" Version="$(MicrosoftVisualStudioValidationVersion)" />
123124
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
124-
<PackageReference Include="Microsoft.ServiceHub.Framework" Version="$(MicrosoftServiceHubFrameworkVersion)" />
125125
</ItemGroup>
126126
</Project>

src/Compilers/Test/Core/Traits/Traits.cs

+1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ public static class Features
246246
public const string GoToBase = nameof(GoToBase);
247247
public const string GoToDefinition = nameof(GoToDefinition);
248248
public const string GoToImplementation = nameof(GoToImplementation);
249+
public const string InheritanceMargin = nameof(InheritanceMargin);
249250
public const string InlineHints = nameof(InlineHints);
250251
public const string Interactive = nameof(Interactive);
251252
public const string InteractiveHost = nameof(InteractiveHost);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
6+
using System.Collections.Generic;
7+
using System.Collections.Immutable;
8+
using System.Composition;
9+
using System.Linq;
10+
using Microsoft.CodeAnalysis.CSharp;
11+
using Microsoft.CodeAnalysis.CSharp.Extensions;
12+
using Microsoft.CodeAnalysis.CSharp.Syntax;
13+
using Microsoft.CodeAnalysis.Host.Mef;
14+
using Microsoft.CodeAnalysis.InheritanceMargin;
15+
using Roslyn.Utilities;
16+
17+
namespace Microsoft.CodeAnalysis.Editor.CSharp.InheritanceMargin
18+
{
19+
[ExportLanguageService(typeof(IInheritanceMarginService), LanguageNames.CSharp), Shared]
20+
internal class CSharpInheritanceMarginService : AbstractInheritanceMarginService
21+
{
22+
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
23+
[ImportingConstructor]
24+
public CSharpInheritanceMarginService()
25+
{
26+
}
27+
28+
protected override ImmutableArray<SyntaxNode> GetMembers(IEnumerable<SyntaxNode> nodesToSearch)
29+
{
30+
var typeDeclarationNodes = nodesToSearch.OfType<TypeDeclarationSyntax>();
31+
32+
using var _ = PooledObjects.ArrayBuilder<SyntaxNode>.GetInstance(out var builder);
33+
foreach (var typeDeclarationNode in typeDeclarationNodes)
34+
{
35+
// 1. Add the type declaration node.(e.g. class, struct etc..)
36+
// Use its identifier's position as the line number, since we want the margin to be placed with the identifier
37+
builder.Add(typeDeclarationNode);
38+
39+
// 2. Add type members inside this type declaration.
40+
foreach (var member in typeDeclarationNode.Members)
41+
{
42+
if (member.IsKind(
43+
SyntaxKind.MethodDeclaration,
44+
SyntaxKind.PropertyDeclaration,
45+
SyntaxKind.EventDeclaration,
46+
SyntaxKind.IndexerDeclaration))
47+
{
48+
builder.Add(member);
49+
}
50+
51+
// For multiple events that declared in the same EventFieldDeclaration,
52+
// add all VariableDeclarators
53+
if (member is EventFieldDeclarationSyntax eventFieldDeclarationNode)
54+
{
55+
builder.AddRange(eventFieldDeclarationNode.Declaration.Variables);
56+
}
57+
}
58+
}
59+
60+
return builder.ToImmutableArray();
61+
}
62+
63+
protected override SyntaxToken GetDeclarationToken(SyntaxNode declarationNode)
64+
=> declarationNode switch
65+
{
66+
MethodDeclarationSyntax methodDeclarationNode => methodDeclarationNode.Identifier,
67+
PropertyDeclarationSyntax propertyDeclarationNode => propertyDeclarationNode.Identifier,
68+
EventDeclarationSyntax eventDeclarationNode => eventDeclarationNode.Identifier,
69+
VariableDeclaratorSyntax variableDeclaratorNode => variableDeclaratorNode.Identifier,
70+
TypeDeclarationSyntax baseTypeDeclarationNode => baseTypeDeclarationNode.Identifier,
71+
IndexerDeclarationSyntax indexerDeclarationNode => indexerDeclarationNode.ThisKeyword,
72+
// Shouldn't reach here since the input declaration nodes are coming from GetMembers() method above
73+
_ => throw ExceptionUtilities.UnexpectedValue(declarationNode),
74+
};
75+
}
76+
}

src/EditorFeatures/CSharpTest2/Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<ItemGroup>
4242
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="$(MicrosoftVisualStudioThreadingVersion)" />
4343
<PackageReference Include="Microsoft.VisualStudio.Imaging" Version="$(MicrosoftVisualStudioImagingVersion)" />
44+
<PackageReference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" Version="$(MicrosoftVisualStudioImagingInterop140DesignTimeVersion)" />
4445
</ItemGroup>
4546
<ItemGroup>
4647
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />

src/EditorFeatures/Core.Cocoa/Microsoft.CodeAnalysis.EditorFeatures.Cocoa.csproj

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@
2828
</ItemGroup>
2929

3030
<ItemGroup>
31-
<PackageReference Include="Microsoft.VisualStudio.Composition" Version="$(MicrosoftVisualStudioCompositionVersion)" />
31+
<PackageReference Include="Microsoft.VisualStudio.Composition" Version="$(MicrosoftVisualStudioCompositionVersion)" />
32+
<PackageReference Include="Microsoft.VisualStudio.ImageCatalog" Version="$(MicrosoftVisualStudioImageCatalogVersion)" />
3233
<PackageReference Include="Microsoft.VisualStudio.Imaging" Version="$(MicrosoftVisualStudioImagingVersion)" />
34+
<PackageReference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" Version="$(MicrosoftVisualStudioImagingInterop140DesignTimeVersion)" />
3335
<PackageReference Include="Microsoft.VisualStudio.Text.Data" Version="$(MicrosoftVisualStudioTextDataVersion)" />
3436
<PackageReference Include="Microsoft.VisualStudio.Text.UI" Version="$(MicrosoftVisualStudioTextUIVersion)" />
3537
<PackageReference Include="Microsoft.VisualStudio.Text.UI.Cocoa" Version="$(MicrosoftVisualStudioTextUICocoaVersion)" />
@@ -40,6 +42,7 @@
4042
<PackageReference Include="XamarinMac" Version="$(XamarinMacVersion)" />
4143
<PackageReference Include="System.ValueTuple" Version="$(SystemValueTupleVersion)" />
4244
</ItemGroup>
45+
4346
<ItemGroup>
4447
<!--
4548
Mono doesn't support embedded interop types, and this package has a targets file that turns it on for all VS SDK librarys, and

src/EditorFeatures/Core.Wpf/Microsoft.CodeAnalysis.EditorFeatures.Wpf.csproj

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@
3030
</ItemGroup>
3131
<ItemGroup>
3232
<PackageReference Include="Microsoft.CodeAnalysis.Elfie" Version="$(MicrosoftCodeAnalysisElfieVersion)" />
33+
<PackageReference Include="Microsoft.VisualStudio.Imaging" Version="$(MicrosoftVisualStudioImagingVersion)" />
34+
<PackageReference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" Version="$(MicrosoftVisualStudioImagingInterop140DesignTimeVersion)" />
3335
<PackageReference Include="Microsoft.VisualStudio.InteractiveWindow" Version="$(MicrosoftVisualStudioInteractiveWindowVersion)" />
36+
<PackageReference Include="Microsoft.VisualStudio.Interop" Version="$(MicrosoftVisualStudioInteropVersion)" />
3437
<PackageReference Include="Microsoft.VisualStudio.Language.NavigateTo.Interfaces" Version="$(MicrosoftVisualStudioLanguageNavigateToInterfacesVersion)" />
3538
<PackageReference Include="Microsoft.VisualStudio.Language.StandardClassification" Version="$(MicrosoftVisualStudioLanguageStandardClassificationVersion)" />
3639
<PackageReference Include="Microsoft.VisualStudio.Language.Intellisense" Version="$(MicrosoftVisualStudioLanguageIntellisenseVersion)" />
3740
<PackageReference Include="Microsoft.VisualStudio.Text.UI.Wpf" Version="$(MicrosoftVisualStudioTextUIWpfVersion)" />
38-
<PackageReference Include="Microsoft.VisualStudio.SDK.EmbedInteropTypes" Version="$(MicrosoftVisualStudioSDKEmbedInteropTypesVersion)" />
3941
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="$(MicrosoftVisualStudioThreadingVersion)" />
4042
</ItemGroup>
4143
<ItemGroup>

src/EditorFeatures/Core/FindUsages/IDefinitionsAndReferencesFactory.cs

+11
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ public static DefinitionItem ToNonClassifiedDefinitionItem(
7070
options: FindReferencesSearchOptions.Default, cancellationToken: CancellationToken.None).WaitAndGetResult_CanCallOnBackground(CancellationToken.None);
7171
}
7272

73+
public static Task<DefinitionItem> ToNonClassifiedDefinitionItemAsync(
74+
this ISymbol definition,
75+
Solution solution,
76+
bool includeHiddenLocations,
77+
CancellationToken cancellationToken)
78+
{
79+
return ToDefinitionItemAsync(
80+
definition, solution, isPrimary: false, includeHiddenLocations, includeClassifiedSpans: false,
81+
options: FindReferencesSearchOptions.Default.With(unidirectionalHierarchyCascade: true), cancellationToken: cancellationToken);
82+
}
83+
7384
public static Task<DefinitionItem> ToClassifiedDefinitionItemAsync(
7485
this ISymbol definition,
7586
Solution solution,

src/EditorFeatures/Core/GoToBase/FindBaseHelpers.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public static ValueTask<ImmutableArray<ISymbol>> FindBasesAsync(
2222
namedTypeSymbol.TypeKind == TypeKind.Interface ||
2323
namedTypeSymbol.TypeKind == TypeKind.Struct))
2424
{
25-
return ValueTaskFactory.FromResult(BaseTypeFinder.FindBaseTypesAndInterfaces(namedTypeSymbol));
25+
var result = BaseTypeFinder.FindBaseTypesAndInterfaces(namedTypeSymbol).CastArray<ISymbol>();
26+
return ValueTaskFactory.FromResult(result);
2627
}
2728

2829
if (symbol.Kind == SymbolKind.Property ||

src/EditorFeatures/Core/GoToDefinition/GoToDefinitionHelpers.cs

+19-3
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ public static ImmutableArray<DefinitionItem> GetDefinitions(
7575
//
7676
// Passing along the classified information is valuable for OOP scenarios where we want
7777
// all that expensive computation done on the OOP side and not in the VS side.
78-
//
78+
//
7979
// However, Go To Definition is all in-process, and is also synchronous. So we do not
80-
// want to fetch the classifications here. It slows down the command and leads to a
80+
// want to fetch the classifications here. It slows down the command and leads to a
8181
// measurable delay in our perf tests.
82-
//
82+
//
8383
// So, if we only have a single location to go to, this does no unnecessary work. And,
8484
// if we do have multiple locations to show, it will just be done in the BG, unblocking
8585
// this command thread so it can return the user faster.
@@ -129,5 +129,21 @@ public static bool TryGoToDefinition(
129129
streamingPresenter.TryNavigateToOrPresentItemsAsync(
130130
threadingContext, solution.Workspace, title, definitions, cancellationToken));
131131
}
132+
133+
public static bool TryGoToDefinition(
134+
ImmutableArray<DefinitionItem> definitions,
135+
Workspace workspace,
136+
string title,
137+
IThreadingContext threadingContext,
138+
IStreamingFindUsagesPresenter streamingPresenter,
139+
CancellationToken cancellationToken)
140+
{
141+
if (definitions.IsDefaultOrEmpty)
142+
return false;
143+
144+
return threadingContext.JoinableTaskFactory.Run(() =>
145+
streamingPresenter.TryNavigateToOrPresentItemsAsync(
146+
threadingContext, workspace, title, definitions, cancellationToken));
147+
}
132148
}
133149
}

0 commit comments

Comments
 (0)