From 8a4d90aac49a40b0b2a3f66ad117c5f9980a2ec2 Mon Sep 17 00:00:00 2001 From: "gel@microsoft.com" Date: Tue, 9 Jul 2024 15:12:56 -0700 Subject: [PATCH 1/7] Refactor for codelens to remvoe VS dependency --- .../Microsoft.CodeAnalysis.EditorFeatures.Wpf.csproj | 1 - .../Core}/CodeLens/ICodeLensContext.cs | 0 .../{Core.Wpf => Core/Extensions}/GlyphExtensions.cs | 0 .../Core/Microsoft.CodeAnalysis.EditorFeatures.csproj | 1 + ...Microsoft.VisualStudio.LanguageServices.CodeLens.csproj | 7 +++++-- 5 files changed, 6 insertions(+), 3 deletions(-) rename src/{VisualStudio/Core/Def => EditorFeatures/Core}/CodeLens/ICodeLensContext.cs (100%) rename src/EditorFeatures/{Core.Wpf => Core/Extensions}/GlyphExtensions.cs (100%) diff --git a/src/EditorFeatures/Core.Wpf/Microsoft.CodeAnalysis.EditorFeatures.Wpf.csproj b/src/EditorFeatures/Core.Wpf/Microsoft.CodeAnalysis.EditorFeatures.Wpf.csproj index d3898b0112583..1562f9717dca0 100644 --- a/src/EditorFeatures/Core.Wpf/Microsoft.CodeAnalysis.EditorFeatures.Wpf.csproj +++ b/src/EditorFeatures/Core.Wpf/Microsoft.CodeAnalysis.EditorFeatures.Wpf.csproj @@ -41,7 +41,6 @@ - diff --git a/src/VisualStudio/Core/Def/CodeLens/ICodeLensContext.cs b/src/EditorFeatures/Core/CodeLens/ICodeLensContext.cs similarity index 100% rename from src/VisualStudio/Core/Def/CodeLens/ICodeLensContext.cs rename to src/EditorFeatures/Core/CodeLens/ICodeLensContext.cs diff --git a/src/EditorFeatures/Core.Wpf/GlyphExtensions.cs b/src/EditorFeatures/Core/Extensions/GlyphExtensions.cs similarity index 100% rename from src/EditorFeatures/Core.Wpf/GlyphExtensions.cs rename to src/EditorFeatures/Core/Extensions/GlyphExtensions.cs diff --git a/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj b/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj index 8f371c1d74eb8..b998a86416a96 100644 --- a/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj +++ b/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj @@ -42,6 +42,7 @@ + diff --git a/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj b/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj index 293aa601e30f7..157257db65be9 100644 --- a/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj +++ b/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj @@ -12,9 +12,12 @@ + - - + + + + From f0c7b84c52d182296b5fa5c31d8ec8c14c05d7bd Mon Sep 17 00:00:00 2001 From: "gel@microsoft.com" Date: Tue, 9 Jul 2024 15:18:24 -0700 Subject: [PATCH 2/7] Reference ImageCatalog --- ...crosoft.CodeAnalysis.EditorFeatures.csproj | 4 +-- .../Test/AssemblyReferenceTests.cs | 34 ------------------- ...ualStudio.LanguageServices.CodeLens.csproj | 1 - 3 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 src/EditorFeatures/Test/AssemblyReferenceTests.cs diff --git a/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj b/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj index b998a86416a96..767984c41511c 100644 --- a/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj +++ b/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj @@ -28,9 +28,7 @@ - - + diff --git a/src/EditorFeatures/Test/AssemblyReferenceTests.cs b/src/EditorFeatures/Test/AssemblyReferenceTests.cs deleted file mode 100644 index 4725d0c1addf5..0000000000000 --- a/src/EditorFeatures/Test/AssemblyReferenceTests.cs +++ /dev/null @@ -1,34 +0,0 @@ -// 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. - -#nullable disable - -using System.Linq; -using Roslyn.Test.Utilities; -using Xunit; - -namespace Microsoft.CodeAnalysis.Editor.UnitTests; - -/// -/// VS for mac has some restrictions on the assemblies that they can load. -/// These tests are created to make sure we don't accidentally add references to the dlls that they cannot load. -/// -public class AssemblyReferenceTests -{ - [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/26642")] - public void TestNoReferenceToImageCatalog() - { - var editorsFeatureAssembly = typeof(Microsoft.CodeAnalysis.Editor.Shared.Extensions.GlyphExtensions).Assembly; - var dependencies = editorsFeatureAssembly.GetReferencedAssemblies(); - Assert.Empty(dependencies.Where(a => a.FullName.Contains("Microsoft.VisualStudio.ImageCatalog"))); - } - - [Fact] - public void TestNoReferenceToImagingInterop() - { - var editorsFeatureAssembly = typeof(Microsoft.CodeAnalysis.Editor.Shared.Extensions.GlyphExtensions).Assembly; - var dependencies = editorsFeatureAssembly.GetReferencedAssemblies(); - Assert.Empty(dependencies.Where(a => a.FullName.Contains("Microsoft.VisualStudio.Imaging.Interop"))); - } -} diff --git a/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj b/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj index 157257db65be9..01803c0ff4dea 100644 --- a/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj +++ b/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj @@ -16,7 +16,6 @@ - From 267e84bb9cbb0b8aaf18526879af4eea12205d14 Mon Sep 17 00:00:00 2001 From: "gel@microsoft.com" Date: Wed, 10 Jul 2024 13:03:31 -0700 Subject: [PATCH 3/7] Target CodeLens to .NET --- .../Microsoft.VisualStudio.LanguageServices.CodeLens.csproj | 2 +- .../ServiceHub.CoreComponents/CoreComponents.Shared.targets | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj b/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj index 01803c0ff4dea..3d49b639bab9b 100644 --- a/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj +++ b/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj @@ -4,7 +4,7 @@ Library Microsoft.VisualStudio.LanguageServices.CodeLens - net472 + netstandard20;$(NetVS) true true diff --git a/src/Workspaces/Remote/ServiceHub.CoreComponents/CoreComponents.Shared.targets b/src/Workspaces/Remote/ServiceHub.CoreComponents/CoreComponents.Shared.targets index 8ce2d5ff4c0e0..e83938239cb6d 100644 --- a/src/Workspaces/Remote/ServiceHub.CoreComponents/CoreComponents.Shared.targets +++ b/src/Workspaces/Remote/ServiceHub.CoreComponents/CoreComponents.Shared.targets @@ -19,6 +19,7 @@ + From 9ecc6164acabd694f863e16d6745bbabf53e2357 Mon Sep 17 00:00:00 2001 From: "gel@microsoft.com" Date: Wed, 10 Jul 2024 15:50:34 -0700 Subject: [PATCH 4/7] Fix --- .../Microsoft.VisualStudio.LanguageServices.CodeLens.csproj | 2 +- .../Core/Def/Microsoft.VisualStudio.LanguageServices.csproj | 1 - .../ServiceHub.CoreComponents/CoreComponents.Shared.targets | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj b/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj index 3d49b639bab9b..3abb2debdc890 100644 --- a/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj +++ b/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj @@ -4,7 +4,7 @@ Library Microsoft.VisualStudio.LanguageServices.CodeLens - netstandard20;$(NetVS) + netstandard2.0;$(NetVS) true true diff --git a/src/VisualStudio/Core/Def/Microsoft.VisualStudio.LanguageServices.csproj b/src/VisualStudio/Core/Def/Microsoft.VisualStudio.LanguageServices.csproj index 3e819572f972b..4f6d123f454fb 100644 --- a/src/VisualStudio/Core/Def/Microsoft.VisualStudio.LanguageServices.csproj +++ b/src/VisualStudio/Core/Def/Microsoft.VisualStudio.LanguageServices.csproj @@ -75,7 +75,6 @@ - diff --git a/src/Workspaces/Remote/ServiceHub.CoreComponents/CoreComponents.Shared.targets b/src/Workspaces/Remote/ServiceHub.CoreComponents/CoreComponents.Shared.targets index e83938239cb6d..1bb66517e980a 100644 --- a/src/Workspaces/Remote/ServiceHub.CoreComponents/CoreComponents.Shared.targets +++ b/src/Workspaces/Remote/ServiceHub.CoreComponents/CoreComponents.Shared.targets @@ -19,6 +19,7 @@ + From e8448ed0a0d3be40f1eb7991cd1f593da297bee8 Mon Sep 17 00:00:00 2001 From: "gel@microsoft.com" Date: Fri, 9 Aug 2024 17:05:14 -0700 Subject: [PATCH 5/7] add dotnet codelens assembly to vsixmanifest --- .../Setup.ServiceHub/arm64/source.extension.vsixmanifest | 1 + .../Setup.ServiceHub/x64/source.extension.vsixmanifest | 1 + 2 files changed, 2 insertions(+) diff --git a/src/VisualStudio/Setup.ServiceHub/arm64/source.extension.vsixmanifest b/src/VisualStudio/Setup.ServiceHub/arm64/source.extension.vsixmanifest index 24f5d5a7bdf17..6af0b50fef88c 100644 --- a/src/VisualStudio/Setup.ServiceHub/arm64/source.extension.vsixmanifest +++ b/src/VisualStudio/Setup.ServiceHub/arm64/source.extension.vsixmanifest @@ -24,6 +24,7 @@ + diff --git a/src/VisualStudio/Setup.ServiceHub/x64/source.extension.vsixmanifest b/src/VisualStudio/Setup.ServiceHub/x64/source.extension.vsixmanifest index d705a91b968d1..dd4a8d56462d7 100644 --- a/src/VisualStudio/Setup.ServiceHub/x64/source.extension.vsixmanifest +++ b/src/VisualStudio/Setup.ServiceHub/x64/source.extension.vsixmanifest @@ -24,6 +24,7 @@ + From 37eb8ed32323db6a14052686f4d533d47e3ba6d7 Mon Sep 17 00:00:00 2001 From: "gel@microsoft.com" Date: Mon, 12 Aug 2024 16:54:29 -0700 Subject: [PATCH 6/7] Remove netfx codelens from vsix --- .../Microsoft.VisualStudio.LanguageServices.CodeLens.csproj | 3 +-- src/VisualStudio/Setup/Roslyn.VisualStudio.Setup.csproj | 6 ------ src/VisualStudio/Setup/source.extension.vsixmanifest | 1 - 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj b/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj index 3abb2debdc890..0f58e2bf74514 100644 --- a/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj +++ b/src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj @@ -4,7 +4,7 @@ Library Microsoft.VisualStudio.LanguageServices.CodeLens - netstandard2.0;$(NetVS) + $(NetVS) true true @@ -23,7 +23,6 @@ - diff --git a/src/VisualStudio/Setup/Roslyn.VisualStudio.Setup.csproj b/src/VisualStudio/Setup/Roslyn.VisualStudio.Setup.csproj index da3eccdcc04b8..fc7afbc3b8f0d 100644 --- a/src/VisualStudio/Setup/Roslyn.VisualStudio.Setup.csproj +++ b/src/VisualStudio/Setup/Roslyn.VisualStudio.Setup.csproj @@ -192,12 +192,6 @@ BindingRedirect 1 - - CodeAnalysisCodeLensVisualStudio - BuiltProjectOutputGroup;SatelliteDllsProjectOutputGroup - true - BindingRedirect - ServicesVisualStudioImpl BuiltProjectOutputGroup;SatelliteDllsProjectOutputGroup diff --git a/src/VisualStudio/Setup/source.extension.vsixmanifest b/src/VisualStudio/Setup/source.extension.vsixmanifest index 5153d20eea9b9..438a34bfc9481 100644 --- a/src/VisualStudio/Setup/source.extension.vsixmanifest +++ b/src/VisualStudio/Setup/source.extension.vsixmanifest @@ -58,7 +58,6 @@ - From fb950ee9ab16d5c298cbb30f102cf901292efba1 Mon Sep 17 00:00:00 2001 From: "gel@microsoft.com" Date: Wed, 21 Aug 2024 15:52:21 -0700 Subject: [PATCH 7/7] Move UnitTestingReferencesService to EditorFeatures layer --- .../ExternalAccess}/UnitTesting/UnitTestingReferencesService.cs | 0 .../Core/Microsoft.CodeAnalysis.EditorFeatures.csproj | 1 + .../Core/Def/Microsoft.VisualStudio.LanguageServices.csproj | 1 - 3 files changed, 1 insertion(+), 1 deletion(-) rename src/{VisualStudio/Core/Def/External => EditorFeatures/Core/ExternalAccess}/UnitTesting/UnitTestingReferencesService.cs (100%) diff --git a/src/VisualStudio/Core/Def/External/UnitTesting/UnitTestingReferencesService.cs b/src/EditorFeatures/Core/ExternalAccess/UnitTesting/UnitTestingReferencesService.cs similarity index 100% rename from src/VisualStudio/Core/Def/External/UnitTesting/UnitTestingReferencesService.cs rename to src/EditorFeatures/Core/ExternalAccess/UnitTesting/UnitTestingReferencesService.cs diff --git a/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj b/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj index 767984c41511c..4c73a2c02380e 100644 --- a/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj +++ b/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj @@ -82,6 +82,7 @@ + diff --git a/src/VisualStudio/Core/Def/Microsoft.VisualStudio.LanguageServices.csproj b/src/VisualStudio/Core/Def/Microsoft.VisualStudio.LanguageServices.csproj index 4f6d123f454fb..007c55fa569e3 100644 --- a/src/VisualStudio/Core/Def/Microsoft.VisualStudio.LanguageServices.csproj +++ b/src/VisualStudio/Core/Def/Microsoft.VisualStudio.LanguageServices.csproj @@ -68,7 +68,6 @@ -