From 55c6b608068f6522044cfc8bcd1dcfa7e9065b1e Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Wed, 7 Sep 2022 15:54:45 -0700 Subject: [PATCH] Link the same IsExternalInit.cs into every project rather than copying it --- Directory.Build.props | 1 + .../IsExternalInit.cs | 10 ---------- .../IsExternalInit.cs | 10 ---------- .../IsExternalInit.cs | 10 ---------- .../IsExternalInit.cs | 10 ---------- .../IsExternalInit.cs | 10 ---------- .../IsExternalInit.cs | 10 ---------- .../IsExternalInit.cs | 10 ---------- .../IsExternalInit.cs | 10 ---------- .../IsExternalInit.cs | 10 ---------- src/Shared/LanguageSupport/IsExternalInit.cs | 20 +++++++++++++++++++ 11 files changed, 21 insertions(+), 90 deletions(-) delete mode 100644 src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer.Protocol/IsExternalInit.cs delete mode 100644 src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IsExternalInit.cs delete mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/IsExternalInit.cs delete mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/IsExternalInit.cs delete mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/IsExternalInit.cs delete mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/IsExternalInit.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test.Common/IsExternalInit.cs delete mode 100644 src/Razor/test/Microsoft.VisualStudio.LanguageServerClient.Razor.Test/IsExternalInit.cs delete mode 100644 src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/IsExternalInit.cs create mode 100644 src/Shared/LanguageSupport/IsExternalInit.cs diff --git a/Directory.Build.props b/Directory.Build.props index d930bf349a..9c500c2dd8 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -48,6 +48,7 @@ + diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer.Protocol/IsExternalInit.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer.Protocol/IsExternalInit.cs deleted file mode 100644 index 484fe9f87f..0000000000 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer.Protocol/IsExternalInit.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -namespace System.Runtime.CompilerServices -{ - // Used to compile against C# 9 in a net472 app. - internal class IsExternalInit - { - } -} diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IsExternalInit.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IsExternalInit.cs deleted file mode 100644 index 484fe9f87f..0000000000 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IsExternalInit.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -namespace System.Runtime.CompilerServices -{ - // Used to compile against C# 9 in a net472 app. - internal class IsExternalInit - { - } -} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/IsExternalInit.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/IsExternalInit.cs deleted file mode 100644 index 5ddae3568a..0000000000 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/IsExternalInit.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -namespace System.Runtime.CompilerServices -{ - // Used to compile against C# 9 in a netstandard2.0 app. - internal class IsExternalInit - { - } -} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/IsExternalInit.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/IsExternalInit.cs deleted file mode 100644 index 484fe9f87f..0000000000 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/IsExternalInit.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -namespace System.Runtime.CompilerServices -{ - // Used to compile against C# 9 in a net472 app. - internal class IsExternalInit - { - } -} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/IsExternalInit.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/IsExternalInit.cs deleted file mode 100644 index 484fe9f87f..0000000000 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/IsExternalInit.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -namespace System.Runtime.CompilerServices -{ - // Used to compile against C# 9 in a net472 app. - internal class IsExternalInit - { - } -} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/IsExternalInit.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/IsExternalInit.cs deleted file mode 100644 index 484fe9f87f..0000000000 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/IsExternalInit.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -namespace System.Runtime.CompilerServices -{ - // Used to compile against C# 9 in a net472 app. - internal class IsExternalInit - { - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test.Common/IsExternalInit.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test.Common/IsExternalInit.cs deleted file mode 100644 index 484fe9f87f..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test.Common/IsExternalInit.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -namespace System.Runtime.CompilerServices -{ - // Used to compile against C# 9 in a net472 app. - internal class IsExternalInit - { - } -} diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServerClient.Razor.Test/IsExternalInit.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServerClient.Razor.Test/IsExternalInit.cs deleted file mode 100644 index 484fe9f87f..0000000000 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServerClient.Razor.Test/IsExternalInit.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -namespace System.Runtime.CompilerServices -{ - // Used to compile against C# 9 in a net472 app. - internal class IsExternalInit - { - } -} diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/IsExternalInit.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/IsExternalInit.cs deleted file mode 100644 index 484fe9f87f..0000000000 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/IsExternalInit.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -namespace System.Runtime.CompilerServices -{ - // Used to compile against C# 9 in a net472 app. - internal class IsExternalInit - { - } -} diff --git a/src/Shared/LanguageSupport/IsExternalInit.cs b/src/Shared/LanguageSupport/IsExternalInit.cs new file mode 100644 index 0000000000..145b2a63e8 --- /dev/null +++ b/src/Shared/LanguageSupport/IsExternalInit.cs @@ -0,0 +1,20 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +#if !NET5_0_OR_GREATER + +using System.ComponentModel; + +namespace System.Runtime.CompilerServices; + +/// +/// Reserved to be used by the compiler for tracking metadata. +/// This class should not be used by developers in source code. +/// This dummy class is required to compile records when targeting .NET Standard +/// +[EditorBrowsable(EditorBrowsableState.Never)] +internal class IsExternalInit +{ +} + +#endif