Skip to content

Commit f50e2b4

Browse files
authored
Merge pull request #8863 from drewnoakes/mef-alias
Alias ImportCardinality via global implicit using
2 parents 9aeabee + ce784f5 commit f50e2b4

File tree

88 files changed

+2
-143
lines changed

Some content is hidden

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

88 files changed

+2
-143
lines changed

Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@
132132
<Using Include="System.Collections.Immutable" />
133133
<!-- There are two namespaces via which MEF attributes are defined. This is the correct one. -->
134134
<Using Include="System.ComponentModel.Composition" />
135+
<!-- Discourage importing all of Microsoft.VisualStudio.Composition by aliasing the most common type(s) we actually use from that namespace. -->
136+
<Using Include="Microsoft.VisualStudio.Composition.ImportCardinality" Alias="ImportCardinality" />
135137
<!-- Prevent accidental use of Microsoft.VisualStudio.Threading.IAsyncDisposable -->
136138
<Using Include="System.IAsyncDisposable" Alias="IAsyncDisposable" />
137139
</ItemGroup>

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ExternalContracts.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// 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.md file in the project root for more information.
22

3-
using Microsoft.VisualStudio.Composition;
43
using Microsoft.VisualStudio.LanguageServices;
54
using Microsoft.VisualStudio.LanguageServices.ProjectSystem;
65
using Microsoft.VisualStudio.ProjectSystem;

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Build/Diagnostics/IncrementalBuildFailureDetector.IProjectChecker.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// 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.md file in the project root for more information.
22

3-
using Microsoft.VisualStudio.Composition;
4-
53
namespace Microsoft.VisualStudio.ProjectSystem.VS.Build.Diagnostics
64
{
75
internal sealed partial class IncrementalBuildFailureDetector

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Debug/IDebugProfileLaunchTargetsProvider.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// 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.md file in the project root for more information.
22

3-
using Microsoft.VisualStudio.Composition;
43
using Microsoft.VisualStudio.ProjectSystem.Debug;
54

65
namespace Microsoft.VisualStudio.ProjectSystem.VS.Debug

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/IEnvironmentOptions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// 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.md file in the project root for more information.
22

3-
using Microsoft.VisualStudio.Composition;
4-
53
namespace Microsoft.VisualStudio.ProjectSystem.VS
64
{
75
/// <summary>

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/IPackageService.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// 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.md file in the project root for more information.
22

3-
using Microsoft.VisualStudio.Composition;
43
using Microsoft.VisualStudio.Shell;
54

65
namespace Microsoft.VisualStudio.ProjectSystem.VS

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/IRoslynServices.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// 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.md file in the project root for more information.
22

33
using Microsoft.CodeAnalysis;
4-
using Microsoft.VisualStudio.Composition;
54

65
namespace Microsoft.VisualStudio.ProjectSystem.VS
76
{

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/IUnconfiguredProjectVsServices.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// 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.md file in the project root for more information.
22

3-
using Microsoft.VisualStudio.Composition;
43
using Microsoft.VisualStudio.Shell.Interop;
54

65
namespace Microsoft.VisualStudio.ProjectSystem.VS

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/IUserNotificationServices.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// 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.md file in the project root for more information.
22

33
using System.Runtime.InteropServices;
4-
using Microsoft.VisualStudio.Composition;
54

65
namespace Microsoft.VisualStudio.ProjectSystem.VS
76
{

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/IVsOnlineServices.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// 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.md file in the project root for more information.
22

3-
using Microsoft.VisualStudio.Composition;
4-
53
namespace Microsoft.VisualStudio.ProjectSystem.VS
64
{
75
[ProjectSystemContract(ProjectSystemContractScope.ProjectService, ProjectSystemContractProvider.Private, Cardinality = ImportCardinality.ExactlyOne)]

0 commit comments

Comments
 (0)