From 98e2c2331c3745ca76ecbbe327664df441115f1a Mon Sep 17 00:00:00 2001 From: CyrusNajmabadi Date: Mon, 8 May 2017 18:07:14 -0700 Subject: [PATCH] Revert "Merge pull request #18972 from CyrusNajmabadi/docHighlights2" This reverts commit 8262112e63d0c92bfa421bcb49e54b6a791cabbd, reversing changes made to 837ca2141fc63d42ea4f6310c07e58624f0ca48a. --- .../CSharp/CSharpEditorFeatures.csproj | 2 + .../CSharpDocumentHighlightsService.cs | 13 +++ ...ighlightingAdditionalReferenceProvider.cs} | 26 +++-- src/EditorFeatures/Core/EditorFeatures.csproj | 19 ++-- ...viewReferenceHighlightingTaggerProvider.cs | 2 +- .../AbstractDocumentHighlightsService.cs | 61 ++++-------- .../DefinitionHighlightTag.cs | 2 +- .../DefinitionHighlightTagDefinition.cs | 2 +- .../IDocumentHighlightsService.cs | 3 +- ...HighlightingAdditionalReferenceProvider.cs | 14 +++ ...htReferenceCommandHandler.StartComparer.cs | 2 +- ...ivateToHighlightReferenceCommandHandler.cs | 2 +- .../ReferenceHighlightTag.cs | 2 +- ...ReferenceHighlightingViewTaggerProvider.cs | 3 +- .../WrittenReferenceHighlightTag.cs | 2 +- .../WrittenReferenceHighlightTagDefinition.cs | 2 +- .../AbstractReferenceHighlightingTests.vb | 11 +-- .../VisualBasic/BasicEditorFeatures.vbproj | 2 + .../VisualBasicDocumentHighlightsService.vb | 6 +- ...HighlightingAdditionalReferenceProvider.vb | 18 ++++ .../CSharp/Portable/CSharpFeatures.csproj | 1 - ...bstractDocumentHighlightsService_Remote.cs | 30 ------ .../DocumentHighlightingOptions.cs | 15 --- .../IRemoteDocumentHighlights.cs | 94 ------------------- src/Features/Core/Portable/Features.csproj | 5 - .../VisualBasic/Portable/BasicFeatures.vbproj | 1 - ...bstractTableDataSourceFindUsagesContext.cs | 2 +- .../WithReferencesFindUsagesContext.cs | 2 +- .../WithoutReferencesFindUsagesContext.cs | 2 +- .../Entries/DocumentSpanEntry.cs | 4 +- .../CSharp/CSharpReferenceHighlighting.cs | 3 +- .../VisualBasic/BasicReferenceHighlighting.cs | 3 +- .../TestUtilities/WellKnownTagNames.cs | 2 +- .../Remote/ServiceHub/ServiceHub.csproj | 1 - .../CodeAnalysisService_DocumentHighlights.cs | 28 ------ 35 files changed, 117 insertions(+), 270 deletions(-) create mode 100644 src/EditorFeatures/CSharp/HighlightReferences/CSharpDocumentHighlightsService.cs rename src/{Features/CSharp/Portable/DocumentHighlighting/CSharpDocumentHighlightsService.cs => EditorFeatures/CSharp/ReferenceHighlighting/ReferenceHighlightingAdditionalReferenceProvider.cs} (70%) rename src/{Features/Core/Portable/DocumentHighlighting => EditorFeatures/Core/Implementation/ReferenceHighlighting}/AbstractDocumentHighlightsService.cs (82%) rename src/EditorFeatures/Core/{ReferenceHighlighting/Tags => Implementation/ReferenceHighlighting}/DefinitionHighlightTag.cs (88%) rename src/EditorFeatures/Core/{ReferenceHighlighting/Tags => Implementation/ReferenceHighlighting}/DefinitionHighlightTagDefinition.cs (92%) rename src/{Features/Core/Portable/DocumentHighlighting => EditorFeatures/Core/Implementation/ReferenceHighlighting}/IDocumentHighlightsService.cs (95%) create mode 100644 src/EditorFeatures/Core/Implementation/ReferenceHighlighting/IReferenceHighlightingAdditionalReferenceProvider.cs rename src/EditorFeatures/Core/{ => Implementation}/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.StartComparer.cs (87%) rename src/EditorFeatures/Core/{ => Implementation}/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.cs (98%) rename src/EditorFeatures/Core/{ReferenceHighlighting/Tags => Implementation/ReferenceHighlighting}/ReferenceHighlightTag.cs (87%) rename src/EditorFeatures/Core/{ => Implementation}/ReferenceHighlighting/ReferenceHighlightingViewTaggerProvider.cs (98%) rename src/EditorFeatures/Core/{ReferenceHighlighting/Tags => Implementation/ReferenceHighlighting}/WrittenReferenceHighlightTag.cs (88%) rename src/EditorFeatures/Core/{ReferenceHighlighting/Tags => Implementation/ReferenceHighlighting}/WrittenReferenceHighlightTagDefinition.cs (91%) rename src/{Features/VisualBasic/Portable/DocumentHighlighting => EditorFeatures/VisualBasic/HighlightReferences}/VisualBasicDocumentHighlightsService.vb (73%) create mode 100644 src/EditorFeatures/VisualBasic/ReferenceHighlighting/ReferenceHighlightingAdditionalReferenceProvider.vb delete mode 100644 src/Features/Core/Portable/DocumentHighlighting/AbstractDocumentHighlightsService_Remote.cs delete mode 100644 src/Features/Core/Portable/DocumentHighlighting/DocumentHighlightingOptions.cs delete mode 100644 src/Features/Core/Portable/DocumentHighlighting/IRemoteDocumentHighlights.cs delete mode 100644 src/Workspaces/Remote/ServiceHub/Services/CodeAnalysisService_DocumentHighlights.cs diff --git a/src/EditorFeatures/CSharp/CSharpEditorFeatures.csproj b/src/EditorFeatures/CSharp/CSharpEditorFeatures.csproj index 4369095c0de..508f732f4d6 100644 --- a/src/EditorFeatures/CSharp/CSharpEditorFeatures.csproj +++ b/src/EditorFeatures/CSharp/CSharpEditorFeatures.csproj @@ -136,12 +136,14 @@ + + diff --git a/src/EditorFeatures/CSharp/HighlightReferences/CSharpDocumentHighlightsService.cs b/src/EditorFeatures/CSharp/HighlightReferences/CSharpDocumentHighlightsService.cs new file mode 100644 index 00000000000..c1f3baf669e --- /dev/null +++ b/src/EditorFeatures/CSharp/HighlightReferences/CSharpDocumentHighlightsService.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Composition; +using Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting; +using Microsoft.CodeAnalysis.Host.Mef; + +namespace Microsoft.CodeAnalysis.Editor.CSharp.HighlightReferences +{ + [ExportLanguageService(typeof(IDocumentHighlightsService), LanguageNames.CSharp), Shared] + internal class CSharpDocumentHighlightsService : AbstractDocumentHighlightsService + { + } +} diff --git a/src/Features/CSharp/Portable/DocumentHighlighting/CSharpDocumentHighlightsService.cs b/src/EditorFeatures/CSharp/ReferenceHighlighting/ReferenceHighlightingAdditionalReferenceProvider.cs similarity index 70% rename from src/Features/CSharp/Portable/DocumentHighlighting/CSharpDocumentHighlightsService.cs rename to src/EditorFeatures/CSharp/ReferenceHighlighting/ReferenceHighlightingAdditionalReferenceProvider.cs index 4788978fd57..2321c81cc55 100644 --- a/src/Features/CSharp/Portable/DocumentHighlighting/CSharpDocumentHighlightsService.cs +++ b/src/EditorFeatures/CSharp/ReferenceHighlighting/ReferenceHighlightingAdditionalReferenceProvider.cs @@ -1,31 +1,32 @@ // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System.Collections.Immutable; +using System.Collections.Generic; using System.Composition; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.CodeAnalysis.DocumentHighlighting; +using Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting; using Microsoft.CodeAnalysis.Host.Mef; +using Roslyn.Utilities; -namespace Microsoft.CodeAnalysis.CSharp.DocumentHighlighting +namespace Microsoft.CodeAnalysis.Editor.CSharp.ReferenceHighlighting { - [ExportLanguageService(typeof(IDocumentHighlightsService), LanguageNames.CSharp), Shared] - internal class CSharpDocumentHighlightsService : AbstractDocumentHighlightsService + [ExportLanguageService(typeof(IReferenceHighlightingAdditionalReferenceProvider), LanguageNames.CSharp), Shared] + internal class ReferenceHighlightingAdditionalReferenceProvider : IReferenceHighlightingAdditionalReferenceProvider { - protected override async Task> GetAdditionalReferencesAsync( + public async Task> GetAdditionalReferencesAsync( Document document, ISymbol symbol, CancellationToken cancellationToken) { // The FindRefs engine won't find references through 'var' for performance reasons. // Also, they are not needed for things like rename/sig change, and the normal find refs - // feature. However, we would like the results to be highlighted to get a good experience + // feature. However, we would lke the results to be highlighted to get a good experience // while editing (especially since highlighting may have been invoked off of 'var' in // the first place). // // So we look for the references through 'var' directly in this file and add them to the // results found by the engine. - var results = ArrayBuilder.GetInstance(); + List results = null; if (symbol is INamedTypeSymbol && symbol.Name != "var") { @@ -51,13 +52,18 @@ internal class CSharpDocumentHighlightsService : AbstractDocumentHighlightsServi if (originalSymbol.Equals(boundSymbol)) { + if (results == null) + { + results = new List(); + } + results.Add(type.GetLocation()); } } } } - return results.ToImmutableAndFree(); + return results ?? SpecializedCollections.EmptyEnumerable(); } } -} \ No newline at end of file +} diff --git a/src/EditorFeatures/Core/EditorFeatures.csproj b/src/EditorFeatures/Core/EditorFeatures.csproj index e7809e7b20f..3a5b371a27e 100644 --- a/src/EditorFeatures/Core/EditorFeatures.csproj +++ b/src/EditorFeatures/Core/EditorFeatures.csproj @@ -168,14 +168,6 @@ - - - - - - - - @@ -638,6 +630,8 @@ + + @@ -649,6 +643,15 @@ + + + + + + + + + diff --git a/src/EditorFeatures/Core/Implementation/Preview/PreviewReferenceHighlightingTaggerProvider.cs b/src/EditorFeatures/Core/Implementation/Preview/PreviewReferenceHighlightingTaggerProvider.cs index 5c90ff6b8f1..29a2060e254 100644 --- a/src/EditorFeatures/Core/Implementation/Preview/PreviewReferenceHighlightingTaggerProvider.cs +++ b/src/EditorFeatures/Core/Implementation/Preview/PreviewReferenceHighlightingTaggerProvider.cs @@ -6,7 +6,7 @@ using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Text.Tagging; using Microsoft.VisualStudio.Utilities; -using Microsoft.CodeAnalysis.Editor.ReferenceHighlighting; +using Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting; namespace Microsoft.CodeAnalysis.Editor.Implementation.Preview { diff --git a/src/Features/Core/Portable/DocumentHighlighting/AbstractDocumentHighlightsService.cs b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/AbstractDocumentHighlightsService.cs similarity index 82% rename from src/Features/Core/Portable/DocumentHighlighting/AbstractDocumentHighlightsService.cs rename to src/EditorFeatures/Core/Implementation/ReferenceHighlighting/AbstractDocumentHighlightsService.cs index 91b1933bd76..8a90b006262 100644 --- a/src/Features/Core/Portable/DocumentHighlighting/AbstractDocumentHighlightsService.cs +++ b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/AbstractDocumentHighlightsService.cs @@ -14,47 +14,12 @@ using Microsoft.CodeAnalysis.Text; using Roslyn.Utilities; -namespace Microsoft.CodeAnalysis.DocumentHighlighting +namespace Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting { - internal abstract partial class AbstractDocumentHighlightsService : IDocumentHighlightsService + internal abstract class AbstractDocumentHighlightsService : IDocumentHighlightsService { public async Task> GetDocumentHighlightsAsync( Document document, int position, IImmutableSet documentsToSearch, CancellationToken cancellationToken) - { - var (succeeded, highlights) = await GetDocumentHighlightsInRemoteProcessAsync( - document, position, documentsToSearch, cancellationToken).ConfigureAwait(false); - - if (succeeded) - { - return highlights; - } - - return await GetDocumentHighlightsInCurrentProcessAsync( - document, position, documentsToSearch, cancellationToken).ConfigureAwait(false); - } - - private async Task<(bool succeeded, ImmutableArray highlights)> GetDocumentHighlightsInRemoteProcessAsync( - Document document, int position, IImmutableSet documentsToSearch, CancellationToken cancellationToken) - { - using (var session = await TryGetRemoteSessionAsync( - document.Project.Solution, cancellationToken).ConfigureAwait(false)) - { - if (session == null) - { - return (succeeded: false, ImmutableArray.Empty); - } - - var result = await session.InvokeAsync( - nameof(IRemoteDocumentHighlights.GetDocumentHighlightsAsync), - document.Id, - position, - documentsToSearch.Select(d => d.Id).ToArray()).ConfigureAwait(false); - return (true, SerializableDocumentHighlights.Rehydrate(result, document.Project.Solution)); - } - } - - private async Task> GetDocumentHighlightsInCurrentProcessAsync( - Document document, int position, IImmutableSet documentsToSearch, CancellationToken cancellationToken) { // use speculative semantic model to see whether we are on a symbol we can do HR var span = new TextSpan(position, 0); @@ -76,11 +41,11 @@ internal abstract partial class AbstractDocumentHighlightsService : IDocumentHig // Get unique tags for referenced symbols return await GetTagsForReferencedSymbolAsync( - new SymbolAndProjectId(symbol, document.Project.Id), documentsToSearch, + new SymbolAndProjectId(symbol, document.Project.Id), documentsToSearch, solution, cancellationToken).ConfigureAwait(false); } - private static async Task GetSymbolToSearchAsync(Document document, int position, SemanticModel semanticModel, ISymbol symbol, CancellationToken cancellationToken) + private async Task GetSymbolToSearchAsync(Document document, int position, SemanticModel semanticModel, ISymbol symbol, CancellationToken cancellationToken) { // see whether we can use the symbol as it is var currentSemanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); @@ -117,7 +82,7 @@ private static async Task GetSymbolToSearchAsync(Document document, int return ImmutableArray.Empty; } - private static bool ShouldConsiderSymbol(ISymbol symbol) + private bool ShouldConsiderSymbol(ISymbol symbol) { switch (symbol.Kind) { @@ -167,13 +132,19 @@ private static bool ShouldConsiderSymbol(ISymbol symbol) documentsToSearch, cancellationToken).ConfigureAwait(false); } - protected virtual Task> GetAdditionalReferencesAsync( + private Task> GetAdditionalReferencesAsync( Document document, ISymbol symbol, CancellationToken cancellationToken) { - return SpecializedTasks.EmptyImmutableArray(); + var additionalReferenceProvider = document.Project.LanguageServices.GetService(); + if (additionalReferenceProvider != null) + { + return additionalReferenceProvider.GetAdditionalReferencesAsync(document, symbol, cancellationToken); + } + + return Task.FromResult(SpecializedCollections.EmptyEnumerable()); } - private static async Task> CreateSpansAsync( + private async Task> CreateSpansAsync( Solution solution, ISymbol symbol, IEnumerable references, @@ -281,7 +252,7 @@ private static bool ShouldIncludeDefinition(ISymbol symbol) return true; } - private static async Task AddLocationSpan(Location location, Solution solution, HashSet spanSet, MultiDictionary tagList, HighlightSpanKind kind, CancellationToken cancellationToken) + private async Task AddLocationSpan(Location location, Solution solution, HashSet spanSet, MultiDictionary tagList, HighlightSpanKind kind, CancellationToken cancellationToken) { var span = await GetLocationSpanAsync(solution, location, cancellationToken).ConfigureAwait(false); if (span != null && !spanSet.Contains(span.Value)) @@ -291,7 +262,7 @@ private static async Task AddLocationSpan(Location location, Solution solution, } } - private static async Task GetLocationSpanAsync( + private async Task GetLocationSpanAsync( Solution solution, Location location, CancellationToken cancellationToken) { try diff --git a/src/EditorFeatures/Core/ReferenceHighlighting/Tags/DefinitionHighlightTag.cs b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/DefinitionHighlightTag.cs similarity index 88% rename from src/EditorFeatures/Core/ReferenceHighlighting/Tags/DefinitionHighlightTag.cs rename to src/EditorFeatures/Core/Implementation/ReferenceHighlighting/DefinitionHighlightTag.cs index 0b974c620bf..2f5873a7594 100644 --- a/src/EditorFeatures/Core/ReferenceHighlighting/Tags/DefinitionHighlightTag.cs +++ b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/DefinitionHighlightTag.cs @@ -2,7 +2,7 @@ using Microsoft.CodeAnalysis.Editor.Shared.Tagging; -namespace Microsoft.CodeAnalysis.Editor.ReferenceHighlighting +namespace Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting { internal class DefinitionHighlightTag : NavigableHighlightTag { diff --git a/src/EditorFeatures/Core/ReferenceHighlighting/Tags/DefinitionHighlightTagDefinition.cs b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/DefinitionHighlightTagDefinition.cs similarity index 92% rename from src/EditorFeatures/Core/ReferenceHighlighting/Tags/DefinitionHighlightTagDefinition.cs rename to src/EditorFeatures/Core/Implementation/ReferenceHighlighting/DefinitionHighlightTagDefinition.cs index 5580291757c..b5a8023f829 100644 --- a/src/EditorFeatures/Core/ReferenceHighlighting/Tags/DefinitionHighlightTagDefinition.cs +++ b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/DefinitionHighlightTagDefinition.cs @@ -5,7 +5,7 @@ using Microsoft.VisualStudio.Text.Classification; using Microsoft.VisualStudio.Utilities; -namespace Microsoft.CodeAnalysis.Editor.ReferenceHighlighting +namespace Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting { [Export(typeof(EditorFormatDefinition))] [Name(DefinitionHighlightTag.TagId)] diff --git a/src/Features/Core/Portable/DocumentHighlighting/IDocumentHighlightsService.cs b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/IDocumentHighlightsService.cs similarity index 95% rename from src/Features/Core/Portable/DocumentHighlighting/IDocumentHighlightsService.cs rename to src/EditorFeatures/Core/Implementation/ReferenceHighlighting/IDocumentHighlightsService.cs index 0e08d4418c4..f86be931963 100644 --- a/src/Features/Core/Portable/DocumentHighlighting/IDocumentHighlightsService.cs +++ b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/IDocumentHighlightsService.cs @@ -1,12 +1,13 @@ // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System.Collections.Generic; using System.Collections.Immutable; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Text; -namespace Microsoft.CodeAnalysis.DocumentHighlighting +namespace Microsoft.CodeAnalysis.Editor { internal enum HighlightSpanKind { diff --git a/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/IReferenceHighlightingAdditionalReferenceProvider.cs b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/IReferenceHighlightingAdditionalReferenceProvider.cs new file mode 100644 index 00000000000..694a5b6e505 --- /dev/null +++ b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/IReferenceHighlightingAdditionalReferenceProvider.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Host; + +namespace Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting +{ + internal interface IReferenceHighlightingAdditionalReferenceProvider : ILanguageService + { + Task> GetAdditionalReferencesAsync(Document document, ISymbol symbol, CancellationToken cancellationToken); + } +} diff --git a/src/EditorFeatures/Core/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.StartComparer.cs b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.StartComparer.cs similarity index 87% rename from src/EditorFeatures/Core/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.StartComparer.cs rename to src/EditorFeatures/Core/Implementation/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.StartComparer.cs index 125416fd751..76b72d5268f 100644 --- a/src/EditorFeatures/Core/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.StartComparer.cs +++ b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.StartComparer.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using Microsoft.VisualStudio.Text; -namespace Microsoft.CodeAnalysis.Editor.ReferenceHighlighting +namespace Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting { internal partial class NavigateToHighlightReferenceCommandHandler { diff --git a/src/EditorFeatures/Core/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.cs b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.cs similarity index 98% rename from src/EditorFeatures/Core/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.cs rename to src/EditorFeatures/Core/Implementation/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.cs index 07a6b67793a..a0997e4009c 100644 --- a/src/EditorFeatures/Core/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.cs +++ b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.cs @@ -14,7 +14,7 @@ using Microsoft.VisualStudio.Text.Tagging; using Roslyn.Utilities; -namespace Microsoft.CodeAnalysis.Editor.ReferenceHighlighting +namespace Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting { [ExportCommandHandler(PredefinedCommandHandlerNames.NavigateToHighlightedReference, ContentTypeNames.RoslynContentType)] diff --git a/src/EditorFeatures/Core/ReferenceHighlighting/Tags/ReferenceHighlightTag.cs b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/ReferenceHighlightTag.cs similarity index 87% rename from src/EditorFeatures/Core/ReferenceHighlighting/Tags/ReferenceHighlightTag.cs rename to src/EditorFeatures/Core/Implementation/ReferenceHighlighting/ReferenceHighlightTag.cs index 299c701a987..6c7d2cddc33 100644 --- a/src/EditorFeatures/Core/ReferenceHighlighting/Tags/ReferenceHighlightTag.cs +++ b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/ReferenceHighlightTag.cs @@ -2,7 +2,7 @@ using Microsoft.CodeAnalysis.Editor.Shared.Tagging; -namespace Microsoft.CodeAnalysis.Editor.ReferenceHighlighting +namespace Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting { internal class ReferenceHighlightTag : NavigableHighlightTag { diff --git a/src/EditorFeatures/Core/ReferenceHighlighting/ReferenceHighlightingViewTaggerProvider.cs b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/ReferenceHighlightingViewTaggerProvider.cs similarity index 98% rename from src/EditorFeatures/Core/ReferenceHighlighting/ReferenceHighlightingViewTaggerProvider.cs rename to src/EditorFeatures/Core/Implementation/ReferenceHighlighting/ReferenceHighlightingViewTaggerProvider.cs index e2367ad5f5d..cbad756b7bd 100644 --- a/src/EditorFeatures/Core/ReferenceHighlighting/ReferenceHighlightingViewTaggerProvider.cs +++ b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/ReferenceHighlightingViewTaggerProvider.cs @@ -6,7 +6,6 @@ using System.ComponentModel.Composition; using System.Linq; using System.Threading.Tasks; -using Microsoft.CodeAnalysis.DocumentHighlighting; using Microsoft.CodeAnalysis.Editor.Shared.Options; using Microsoft.CodeAnalysis.Editor.Shared.Tagging; using Microsoft.CodeAnalysis.Editor.Tagging; @@ -22,7 +21,7 @@ using Microsoft.VisualStudio.Utilities; using Roslyn.Utilities; -namespace Microsoft.CodeAnalysis.Editor.ReferenceHighlighting +namespace Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting { [Export(typeof(IViewTaggerProvider))] [ContentType(ContentTypeNames.RoslynContentType)] diff --git a/src/EditorFeatures/Core/ReferenceHighlighting/Tags/WrittenReferenceHighlightTag.cs b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/WrittenReferenceHighlightTag.cs similarity index 88% rename from src/EditorFeatures/Core/ReferenceHighlighting/Tags/WrittenReferenceHighlightTag.cs rename to src/EditorFeatures/Core/Implementation/ReferenceHighlighting/WrittenReferenceHighlightTag.cs index d6f8df3342b..b4d35d64ae6 100644 --- a/src/EditorFeatures/Core/ReferenceHighlighting/Tags/WrittenReferenceHighlightTag.cs +++ b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/WrittenReferenceHighlightTag.cs @@ -2,7 +2,7 @@ using Microsoft.CodeAnalysis.Editor.Shared.Tagging; -namespace Microsoft.CodeAnalysis.Editor.ReferenceHighlighting +namespace Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting { internal class WrittenReferenceHighlightTag : NavigableHighlightTag { diff --git a/src/EditorFeatures/Core/ReferenceHighlighting/Tags/WrittenReferenceHighlightTagDefinition.cs b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/WrittenReferenceHighlightTagDefinition.cs similarity index 91% rename from src/EditorFeatures/Core/ReferenceHighlighting/Tags/WrittenReferenceHighlightTagDefinition.cs rename to src/EditorFeatures/Core/Implementation/ReferenceHighlighting/WrittenReferenceHighlightTagDefinition.cs index 74323824a50..8db19cc5cb2 100644 --- a/src/EditorFeatures/Core/ReferenceHighlighting/Tags/WrittenReferenceHighlightTagDefinition.cs +++ b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/WrittenReferenceHighlightTagDefinition.cs @@ -5,7 +5,7 @@ using Microsoft.VisualStudio.Text.Classification; using Microsoft.VisualStudio.Utilities; -namespace Microsoft.CodeAnalysis.Editor.ReferenceHighlighting +namespace Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting { [Export(typeof(EditorFormatDefinition))] [Name(WrittenReferenceHighlightTag.TagId)] diff --git a/src/EditorFeatures/Test2/ReferenceHighlighting/AbstractReferenceHighlightingTests.vb b/src/EditorFeatures/Test2/ReferenceHighlighting/AbstractReferenceHighlightingTests.vb index 7c959127461..ab5ab6a8ab8 100644 --- a/src/EditorFeatures/Test2/ReferenceHighlighting/AbstractReferenceHighlightingTests.vb +++ b/src/EditorFeatures/Test2/ReferenceHighlighting/AbstractReferenceHighlightingTests.vb @@ -1,8 +1,7 @@ ' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports System.Threading -Imports Microsoft.CodeAnalysis.DocumentHighlighting -Imports Microsoft.CodeAnalysis.Editor.ReferenceHighlighting +Imports Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting Imports Microsoft.CodeAnalysis.Editor.Shared.Extensions Imports Microsoft.CodeAnalysis.Editor.Shared.Options Imports Microsoft.CodeAnalysis.Editor.Shared.Tagging @@ -17,17 +16,9 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.ReferenceHighlighting Public MustInherit Class AbstractReferenceHighlightingTests Protected Async Function VerifyHighlightsAsync(test As XElement, Optional optionIsEnabled As Boolean = True) As Tasks.Task - Await VerifyHighlightsAsync(test, optionIsEnabled, outOfProcess:=False) - Await VerifyHighlightsAsync(test, optionIsEnabled, outOfProcess:=True) - End Function - - Private Async Function VerifyHighlightsAsync(test As XElement, optionIsEnabled As Boolean, outOfProcess As Boolean) As Tasks.Task Using workspace = TestWorkspace.Create(test) WpfTestCase.RequireWpfFact($"{NameOf(AbstractReferenceHighlightingTests)}.VerifyHighlightsAsync creates asynchronous taggers") - workspace.Options = workspace.Options.WithChangedOption( - DocumentHighlightingOptions.OutOfProcessAllowed, outOfProcess) - Dim tagProducer = New ReferenceHighlightingViewTaggerProvider( workspace.GetService(Of IForegroundNotificationService), workspace.GetService(Of ISemanticChangeNotificationService), diff --git a/src/EditorFeatures/VisualBasic/BasicEditorFeatures.vbproj b/src/EditorFeatures/VisualBasic/BasicEditorFeatures.vbproj index 79ee5ff8d6c..531d79a604a 100644 --- a/src/EditorFeatures/VisualBasic/BasicEditorFeatures.vbproj +++ b/src/EditorFeatures/VisualBasic/BasicEditorFeatures.vbproj @@ -129,6 +129,7 @@ + @@ -154,6 +155,7 @@ + diff --git a/src/Features/VisualBasic/Portable/DocumentHighlighting/VisualBasicDocumentHighlightsService.vb b/src/EditorFeatures/VisualBasic/HighlightReferences/VisualBasicDocumentHighlightsService.vb similarity index 73% rename from src/Features/VisualBasic/Portable/DocumentHighlighting/VisualBasicDocumentHighlightsService.vb rename to src/EditorFeatures/VisualBasic/HighlightReferences/VisualBasicDocumentHighlightsService.vb index 2f925d3749e..b0693439b5d 100644 --- a/src/Features/VisualBasic/Portable/DocumentHighlighting/VisualBasicDocumentHighlightsService.vb +++ b/src/EditorFeatures/VisualBasic/HighlightReferences/VisualBasicDocumentHighlightsService.vb @@ -1,13 +1,13 @@ ' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports System.Composition -Imports Microsoft.CodeAnalysis.DocumentHighlighting +Imports Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting Imports Microsoft.CodeAnalysis.Host.Mef -Namespace Microsoft.CodeAnalysis.VisualBasic.DocumentHighlighting +Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.HighlightReferences Friend Class VisualBasicDocumentHighlightsService Inherits AbstractDocumentHighlightsService End Class -End Namespace \ No newline at end of file +End Namespace diff --git a/src/EditorFeatures/VisualBasic/ReferenceHighlighting/ReferenceHighlightingAdditionalReferenceProvider.vb b/src/EditorFeatures/VisualBasic/ReferenceHighlighting/ReferenceHighlightingAdditionalReferenceProvider.vb new file mode 100644 index 00000000000..2c95b09d3a2 --- /dev/null +++ b/src/EditorFeatures/VisualBasic/ReferenceHighlighting/ReferenceHighlightingAdditionalReferenceProvider.vb @@ -0,0 +1,18 @@ +' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +Imports System.Composition +Imports System.Threading +Imports System.Threading.Tasks +Imports Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting +Imports Microsoft.CodeAnalysis.Host.Mef + +Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.ReferenceHighlighting + + Friend Class ReferenceHighlightingAdditionalReferenceProvider + Implements IReferenceHighlightingAdditionalReferenceProvider + + Public Function GetAdditionalReferencesAsync(document As Document, symbol As ISymbol, cancellationToken As CancellationToken) As Task(Of IEnumerable(Of Location)) Implements IReferenceHighlightingAdditionalReferenceProvider.GetAdditionalReferencesAsync + Return SpecializedTasks.EmptyEnumerable(Of Location)() + End Function + End Class +End Namespace diff --git a/src/Features/CSharp/Portable/CSharpFeatures.csproj b/src/Features/CSharp/Portable/CSharpFeatures.csproj index 0e91914a132..07d23798af9 100644 --- a/src/Features/CSharp/Portable/CSharpFeatures.csproj +++ b/src/Features/CSharp/Portable/CSharpFeatures.csproj @@ -81,7 +81,6 @@ - diff --git a/src/Features/Core/Portable/DocumentHighlighting/AbstractDocumentHighlightsService_Remote.cs b/src/Features/Core/Portable/DocumentHighlighting/AbstractDocumentHighlightsService_Remote.cs deleted file mode 100644 index 7efad4a9663..00000000000 --- a/src/Features/Core/Portable/DocumentHighlighting/AbstractDocumentHighlightsService_Remote.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Threading; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Remote; - -namespace Microsoft.CodeAnalysis.DocumentHighlighting -{ - internal abstract partial class AbstractDocumentHighlightsService : IDocumentHighlightsService - { - private static async Task TryGetRemoteSessionAsync( - Solution solution, CancellationToken cancellationToken) - { - var outOfProcessAllowed = solution.Workspace.Options.GetOption(DocumentHighlightingOptions.OutOfProcessAllowed); - if (!outOfProcessAllowed) - { - return null; - } - - var client = await solution.Workspace.TryGetRemoteHostClientAsync(cancellationToken).ConfigureAwait(false); - if (client == null) - { - return null; - } - - return await client.TryCreateCodeAnalysisServiceSessionAsync( - solution, cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/Features/Core/Portable/DocumentHighlighting/DocumentHighlightingOptions.cs b/src/Features/Core/Portable/DocumentHighlighting/DocumentHighlightingOptions.cs deleted file mode 100644 index 0363999301f..00000000000 --- a/src/Features/Core/Portable/DocumentHighlighting/DocumentHighlightingOptions.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Microsoft.CodeAnalysis.Options; - -namespace Microsoft.CodeAnalysis.DocumentHighlighting -{ - internal static class DocumentHighlightingOptions - { - private const string LocalRegistryPath = @"Roslyn\Features\DocumentHighlighting\"; - - public static readonly Option OutOfProcessAllowed = new Option( - nameof(DocumentHighlightingOptions), nameof(OutOfProcessAllowed), defaultValue: false, - storageLocations: new LocalUserProfileStorageLocation(LocalRegistryPath + nameof(OutOfProcessAllowed))); - } -} \ No newline at end of file diff --git a/src/Features/Core/Portable/DocumentHighlighting/IRemoteDocumentHighlights.cs b/src/Features/Core/Portable/DocumentHighlighting/IRemoteDocumentHighlights.cs deleted file mode 100644 index b58c6f35a18..00000000000 --- a/src/Features/Core/Portable/DocumentHighlighting/IRemoteDocumentHighlights.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections.Immutable; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Text; - -namespace Microsoft.CodeAnalysis.DocumentHighlighting -{ - internal interface IRemoteDocumentHighlights - { - Task GetDocumentHighlightsAsync( - DocumentId documentId, int position, DocumentId[] documentIdsToSearch); - } - - internal struct SerializableDocumentHighlights - { - public DocumentId DocumentId; - public SerializableHighlightSpan[] HighlightSpans; - - public static ImmutableArray Rehydrate(SerializableDocumentHighlights[] array, Solution solution) - { - var result = ArrayBuilder.GetInstance(array.Length); - foreach (var dehydrated in array) - { - result.Push(dehydrated.Rehydrate(solution)); - } - - return result.ToImmutableAndFree(); - } - - private DocumentHighlights Rehydrate(Solution solution) - => new DocumentHighlights(solution.GetDocument(DocumentId), SerializableHighlightSpan.Rehydrate(HighlightSpans)); - - public static SerializableDocumentHighlights[] Dehydrate(ImmutableArray array) - { - var result = new SerializableDocumentHighlights[array.Length]; - var index = 0; - foreach (var highlights in array) - { - result[index] = Dehydrate(highlights); - index++; - } - - return result; - } - - private static SerializableDocumentHighlights Dehydrate(DocumentHighlights highlights) - => new SerializableDocumentHighlights - { - DocumentId = highlights.Document.Id, - HighlightSpans = SerializableHighlightSpan.Dehydrate(highlights.HighlightSpans) - }; - } - - internal struct SerializableHighlightSpan - { - public TextSpan TextSpan; - public HighlightSpanKind Kind; - - internal static SerializableHighlightSpan[] Dehydrate(ImmutableArray array) - { - var result = new SerializableHighlightSpan[array.Length]; - var index = 0; - foreach (var span in array) - { - result[index] = Dehydrate(span); - index++; - } - - return result; - } - - private static SerializableHighlightSpan Dehydrate(HighlightSpan span) - => new SerializableHighlightSpan - { - Kind = span.Kind, - TextSpan = span.TextSpan - }; - - internal static ImmutableArray Rehydrate(SerializableHighlightSpan[] array) - { - var result = ArrayBuilder.GetInstance(array.Length); - foreach (var dehydrated in array) - { - result.Push(dehydrated.Rehydrate()); - } - - return result.ToImmutableAndFree(); - } - - private HighlightSpan Rehydrate() - => new HighlightSpan(TextSpan, Kind); - } -} \ No newline at end of file diff --git a/src/Features/Core/Portable/Features.csproj b/src/Features/Core/Portable/Features.csproj index 25a06421f43..cff5327a8c5 100644 --- a/src/Features/Core/Portable/Features.csproj +++ b/src/Features/Core/Portable/Features.csproj @@ -132,7 +132,6 @@ - @@ -158,10 +157,6 @@ - - - - diff --git a/src/Features/VisualBasic/Portable/BasicFeatures.vbproj b/src/Features/VisualBasic/Portable/BasicFeatures.vbproj index 884a29b8778..7369bfd880c 100644 --- a/src/Features/VisualBasic/Portable/BasicFeatures.vbproj +++ b/src/Features/VisualBasic/Portable/BasicFeatures.vbproj @@ -66,7 +66,6 @@ InternalUtilities\LambdaUtilities.vb - diff --git a/src/VisualStudio/Core/Next/FindReferences/Contexts/AbstractTableDataSourceFindUsagesContext.cs b/src/VisualStudio/Core/Next/FindReferences/Contexts/AbstractTableDataSourceFindUsagesContext.cs index c8cf14161ae..e593f2f5ab5 100644 --- a/src/VisualStudio/Core/Next/FindReferences/Contexts/AbstractTableDataSourceFindUsagesContext.cs +++ b/src/VisualStudio/Core/Next/FindReferences/Contexts/AbstractTableDataSourceFindUsagesContext.cs @@ -7,7 +7,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.DocumentHighlighting; +using Microsoft.CodeAnalysis.Editor; using Microsoft.CodeAnalysis.Editor.FindUsages; using Microsoft.CodeAnalysis.FindUsages; using Microsoft.CodeAnalysis.Text; diff --git a/src/VisualStudio/Core/Next/FindReferences/Contexts/WithReferencesFindUsagesContext.cs b/src/VisualStudio/Core/Next/FindReferences/Contexts/WithReferencesFindUsagesContext.cs index 765612f4c86..9973893c246 100644 --- a/src/VisualStudio/Core/Next/FindReferences/Contexts/WithReferencesFindUsagesContext.cs +++ b/src/VisualStudio/Core/Next/FindReferences/Contexts/WithReferencesFindUsagesContext.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Completion; -using Microsoft.CodeAnalysis.DocumentHighlighting; +using Microsoft.CodeAnalysis.Editor; using Microsoft.CodeAnalysis.FindUsages; using Microsoft.VisualStudio.Shell.FindAllReferences; using Roslyn.Utilities; diff --git a/src/VisualStudio/Core/Next/FindReferences/Contexts/WithoutReferencesFindUsagesContext.cs b/src/VisualStudio/Core/Next/FindReferences/Contexts/WithoutReferencesFindUsagesContext.cs index 2456a495cfe..5a5f6a2b02b 100644 --- a/src/VisualStudio/Core/Next/FindReferences/Contexts/WithoutReferencesFindUsagesContext.cs +++ b/src/VisualStudio/Core/Next/FindReferences/Contexts/WithoutReferencesFindUsagesContext.cs @@ -3,7 +3,7 @@ using System; using System.Threading.Tasks; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.DocumentHighlighting; +using Microsoft.CodeAnalysis.Editor; using Microsoft.CodeAnalysis.FindUsages; using Microsoft.VisualStudio.Shell.FindAllReferences; using Roslyn.Utilities; diff --git a/src/VisualStudio/Core/Next/FindReferences/Entries/DocumentSpanEntry.cs b/src/VisualStudio/Core/Next/FindReferences/Entries/DocumentSpanEntry.cs index f32bade84b9..68c45919b30 100644 --- a/src/VisualStudio/Core/Next/FindReferences/Entries/DocumentSpanEntry.cs +++ b/src/VisualStudio/Core/Next/FindReferences/Entries/DocumentSpanEntry.cs @@ -7,11 +7,10 @@ using System.Windows.Media; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Classification; -using Microsoft.CodeAnalysis.DocumentHighlighting; using Microsoft.CodeAnalysis.Editor; using Microsoft.CodeAnalysis.Editor.FindUsages; using Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.QuickInfo; -using Microsoft.CodeAnalysis.Editor.ReferenceHighlighting; +using Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting; using Microsoft.CodeAnalysis.Editor.Shared.Extensions; using Microsoft.CodeAnalysis.Editor.Shared.Preview; using Microsoft.CodeAnalysis.FindUsages; @@ -19,6 +18,7 @@ using Microsoft.CodeAnalysis.Text.Shared.Extensions; using Microsoft.VisualStudio.LanguageServices.Implementation.Extensions; using Microsoft.VisualStudio.PlatformUI; +using Microsoft.VisualStudio.Shell.TableControl; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Editor; diff --git a/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpReferenceHighlighting.cs b/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpReferenceHighlighting.cs index 8f527cbb55a..627ac96efc0 100644 --- a/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpReferenceHighlighting.cs +++ b/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpReferenceHighlighting.cs @@ -3,10 +3,11 @@ using System.Collections.Generic; using System.Collections.Immutable; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Editor.ReferenceHighlighting; +using Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting; using Microsoft.CodeAnalysis.Shared.TestHooks; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.IntegrationTest.Utilities; +using Microsoft.VisualStudio.IntegrationTest.Utilities.Input; using Roslyn.Test.Utilities; using Xunit; diff --git a/src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicReferenceHighlighting.cs b/src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicReferenceHighlighting.cs index 86a0a05fec4..873349a13f9 100644 --- a/src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicReferenceHighlighting.cs +++ b/src/VisualStudio/IntegrationTest/IntegrationTests/VisualBasic/BasicReferenceHighlighting.cs @@ -3,10 +3,11 @@ using System.Collections.Generic; using System.Collections.Immutable; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Editor.ReferenceHighlighting; +using Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting; using Microsoft.CodeAnalysis.Shared.TestHooks; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.IntegrationTest.Utilities; +using Microsoft.VisualStudio.IntegrationTest.Utilities.Input; using Roslyn.Test.Utilities; using Xunit; diff --git a/src/VisualStudio/IntegrationTest/TestUtilities/WellKnownTagNames.cs b/src/VisualStudio/IntegrationTest/TestUtilities/WellKnownTagNames.cs index 98dd6cba799..d765685a409 100644 --- a/src/VisualStudio/IntegrationTest/TestUtilities/WellKnownTagNames.cs +++ b/src/VisualStudio/IntegrationTest/TestUtilities/WellKnownTagNames.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.CodeAnalysis.Editor.ReferenceHighlighting; +using Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting; namespace Microsoft.VisualStudio.IntegrationTest.Utilities { diff --git a/src/Workspaces/Remote/ServiceHub/ServiceHub.csproj b/src/Workspaces/Remote/ServiceHub/ServiceHub.csproj index 68fe27e68b2..1d5b8a99024 100644 --- a/src/Workspaces/Remote/ServiceHub/ServiceHub.csproj +++ b/src/Workspaces/Remote/ServiceHub/ServiceHub.csproj @@ -73,7 +73,6 @@ - diff --git a/src/Workspaces/Remote/ServiceHub/Services/CodeAnalysisService_DocumentHighlights.cs b/src/Workspaces/Remote/ServiceHub/Services/CodeAnalysisService_DocumentHighlights.cs deleted file mode 100644 index b98c8e58a91..00000000000 --- a/src/Workspaces/Remote/ServiceHub/Services/CodeAnalysisService_DocumentHighlights.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections.Immutable; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.DocumentHighlighting; -using Microsoft.CodeAnalysis.Shared.Extensions; - -namespace Microsoft.CodeAnalysis.Remote -{ - // root level service for all Roslyn services - internal partial class CodeAnalysisService : IRemoteDocumentHighlights - { - public async Task GetDocumentHighlightsAsync( - DocumentId documentId, int position, DocumentId[] documentIdsToSearch) - { - var solution = await GetSolutionAsync().ConfigureAwait(false); - var document = solution.GetDocument(documentId); - var documentsToSearch = ImmutableHashSet.CreateRange(documentIdsToSearch.Select(solution.GetDocument)); - - var service = document.GetLanguageService(); - var result = await service.GetDocumentHighlightsAsync( - document, position, documentsToSearch, CancellationToken).ConfigureAwait(false); - - return SerializableDocumentHighlights.Dehydrate(result); - } - } -} \ No newline at end of file -- GitLab