diff --git a/src/VisualStudio/Core/Def/Implementation/Progression/GraphQueries/SearchGraphQuery.cs b/src/VisualStudio/Core/Def/Implementation/Progression/GraphQueries/SearchGraphQuery.cs index c2529704a5ec5..4958aa8ace46a 100644 --- a/src/VisualStudio/Core/Def/Implementation/Progression/GraphQueries/SearchGraphQuery.cs +++ b/src/VisualStudio/Core/Def/Implementation/Progression/GraphQueries/SearchGraphQuery.cs @@ -2,21 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Linq; -using System.Runtime.ExceptionServices; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Editor.Shared.Utilities; -using Microsoft.CodeAnalysis.FindSymbols; using Microsoft.CodeAnalysis.NavigateTo; -using Microsoft.CodeAnalysis.PooledObjects; -using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Shared.TestHooks; using Microsoft.VisualStudio.GraphModel; -using Roslyn.Utilities; namespace Microsoft.VisualStudio.LanguageServices.Implementation.Progression { @@ -36,16 +28,7 @@ public SearchGraphQuery( _searchPattern = searchPattern; } - public Task GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken) - { - var forceLegacySearch = solution.Options.GetOption(ProgressionOptions.LegacySearchFeatureFlag); - var option = solution.Options.GetOption(ProgressionOptions.SearchUsingNavigateToEngine); - return !forceLegacySearch && option - ? SearchUsingNavigateToEngineAsync(solution, context, cancellationToken) - : SearchUsingSymbolsAsync(solution, context, cancellationToken); - } - - private async Task SearchUsingNavigateToEngineAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken) + public async Task GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken) { var graphBuilder = await GraphBuilder.CreateForInputNodesAsync(solution, context.InputNodes, cancellationToken).ConfigureAwait(false); var callback = new ProgressionNavigateToSearchCallback(context, graphBuilder); @@ -62,171 +45,5 @@ private async Task SearchUsingNavigateToEngineAsync(Solution solut return graphBuilder; } - - private async Task SearchUsingSymbolsAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken) - { - var graphBuilder = await GraphBuilder.CreateForInputNodesAsync(solution, context.InputNodes, cancellationToken).ConfigureAwait(false); - - var searchTasks = solution.Projects - .Where(p => p.FilePath != null) - .Select(p => ProcessProjectAsync(p, graphBuilder, cancellationToken)) - .ToArray(); - await Task.WhenAll(searchTasks).ConfigureAwait(false); - - return graphBuilder; - } - - private async Task ProcessProjectAsync(Project project, GraphBuilder graphBuilder, CancellationToken cancellationToken) - { - var cacheService = project.Solution.Services.CacheService; - if (cacheService != null) - { - using (cacheService.EnableCaching(project.Id)) - { - var results = await FindNavigableSourceSymbolsAsync(project, cancellationToken).ConfigureAwait(false); - - foreach (var symbol in results) - { - cancellationToken.ThrowIfCancellationRequested(); - - if (symbol is INamedTypeSymbol namedType) - { - await AddLinkedNodeForTypeAsync( - project, namedType, graphBuilder, - symbol.DeclaringSyntaxReferences.Select(d => d.SyntaxTree), - cancellationToken).ConfigureAwait(false); - } - else - { - await AddLinkedNodeForMemberAsync( - project, symbol, graphBuilder, cancellationToken).ConfigureAwait(false); - } - } - } - } - } - - private async Task AddLinkedNodeForTypeAsync( - Project project, INamedTypeSymbol namedType, GraphBuilder graphBuilder, - IEnumerable syntaxTrees, CancellationToken cancellationToken) - { - // If this named type is contained in a parent type, then just link farther up - if (namedType.ContainingType != null) - { - var parentTypeNode = await AddLinkedNodeForTypeAsync( - project, namedType.ContainingType, graphBuilder, syntaxTrees, cancellationToken).ConfigureAwait(false); - var typeNode = await graphBuilder.AddNodeAsync(namedType, relatedNode: parentTypeNode, cancellationToken).ConfigureAwait(false); - graphBuilder.AddLink(parentTypeNode, GraphCommonSchema.Contains, typeNode, cancellationToken); - - return typeNode; - } - else - { - // From here, we can link back up to the containing project item - var typeNode = await graphBuilder.AddNodeAsync( - namedType, contextProject: project, contextDocument: null, cancellationToken).ConfigureAwait(false); - - foreach (var tree in syntaxTrees) - { - var document = project.Solution.GetDocument(tree); - Contract.ThrowIfNull(document); - - var documentNode = graphBuilder.AddNodeForDocument(document, cancellationToken); - graphBuilder.AddLink(documentNode, GraphCommonSchema.Contains, typeNode, cancellationToken); - } - - return typeNode; - } - } - - private async Task AddLinkedNodeForMemberAsync( - Project project, ISymbol symbol, GraphBuilder graphBuilder, CancellationToken cancellationToken) - { - var member = symbol; - Contract.ThrowIfNull(member.ContainingType); - - var trees = member.DeclaringSyntaxReferences.Select(d => d.SyntaxTree); - - var parentTypeNode = await AddLinkedNodeForTypeAsync( - project, member.ContainingType, graphBuilder, trees, cancellationToken).ConfigureAwait(false); - var memberNode = await graphBuilder.AddNodeAsync( - symbol, relatedNode: parentTypeNode, cancellationToken).ConfigureAwait(false); - graphBuilder.AddLink(parentTypeNode, GraphCommonSchema.Contains, memberNode, cancellationToken); - - return memberNode; - } - - internal async Task> FindNavigableSourceSymbolsAsync( - Project project, CancellationToken cancellationToken) - { - ImmutableArray declarations; - - // FindSourceDeclarationsWithPatternAsync calls into OOP to do the search; if something goes badly it - // throws a SoftCrashException which inherits from OperationCanceledException. This is unfortunate, because - // it means that other bits of code see this as a cancellation and then may crash because they expect that if this - // method is raising cancellation, it's because cancellationToken requested the cancellation. The intent behind - // SoftCrashException was since it inherited from OperationCancelled it would make things safer, but in this case - // it's violating other invariants in the process which creates other problems. - // - // https://github.com/dotnet/roslyn/issues/40476 tracks removing SoftCrashException. When it is removed, the - // catch here can be removed and simply let the exception propagate; our Progression code is hardened to - // handle exceptions and report them gracefully. - try - { - declarations = await DeclarationFinder.FindSourceDeclarationsWithPatternAsync( - project, _searchPattern, SymbolFilter.TypeAndMember, cancellationToken).ConfigureAwait(false); - } - catch (SoftCrashException ex) when (ex.InnerException != null) - { - ExceptionDispatchInfo.Capture(ex.InnerException).Throw(); - throw ExceptionUtilities.Unreachable; - } - - using var _ = ArrayBuilder.GetInstance(out var results); - - foreach (var declaration in declarations) - { - cancellationToken.ThrowIfCancellationRequested(); - - var symbol = declaration; - - // Ignore constructors and namespaces. We don't want to expose them through this API. - if (symbol.IsConstructor() || - symbol.IsStaticConstructor() || - symbol is INamespaceSymbol) - { - continue; - } - - // Ignore symbols that have no source location. We don't want to expose them through this API. - if (!symbol.Locations.Any(loc => loc.IsInSource)) - { - continue; - } - - results.Add(declaration); - - // also report matching constructors (using same match result as type) - if (symbol is INamedTypeSymbol namedType) - { - foreach (var constructor in namedType.Constructors) - { - // only constructors that were explicitly declared - if (!constructor.IsImplicitlyDeclared) - { - results.Add(constructor); - } - } - } - - // report both parts of partial methods - if (symbol is IMethodSymbol method && method.PartialImplementationPart != null) - { - results.Add(method); - } - } - - return results.ToImmutable(); - } } } diff --git a/src/VisualStudio/Core/Def/Implementation/Progression/ProgressionOptions.cs b/src/VisualStudio/Core/Def/Implementation/Progression/ProgressionOptions.cs deleted file mode 100644 index 581e19ac2d0cc..0000000000000 --- a/src/VisualStudio/Core/Def/Implementation/Progression/ProgressionOptions.cs +++ /dev/null @@ -1,22 +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. - -using Microsoft.CodeAnalysis.Options; - -namespace Microsoft.VisualStudio.LanguageServices.Implementation.Progression -{ - internal static class ProgressionOptions - { - private const string FeatureName = "ProgressionOptions"; - private const string LocalRegistryPath = @"Roslyn\Internal\OnOff\Components\Progression\"; - - public static readonly Option2 SearchUsingNavigateToEngine = new( - FeatureName, nameof(SearchUsingNavigateToEngine), defaultValue: true, - new LocalUserProfileStorageLocation(LocalRegistryPath + "SearchUsingNavigateToEngine")); - - public static readonly Option LegacySearchFeatureFlag = new( - FeatureName, nameof(LegacySearchFeatureFlag), defaultValue: false, - new FeatureFlagStorageLocation("Roslyn.ProgressionForceLegacySearch")); - } -} diff --git a/src/VisualStudio/Core/Def/Implementation/Progression/ProgressionOptionsProvider.cs b/src/VisualStudio/Core/Def/Implementation/Progression/ProgressionOptionsProvider.cs deleted file mode 100644 index b283143739fcc..0000000000000 --- a/src/VisualStudio/Core/Def/Implementation/Progression/ProgressionOptionsProvider.cs +++ /dev/null @@ -1,27 +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. - -using System; -using System.Collections.Immutable; -using System.Composition; -using Microsoft.CodeAnalysis.Host.Mef; -using Microsoft.CodeAnalysis.Options; -using Microsoft.CodeAnalysis.Options.Providers; - -namespace Microsoft.VisualStudio.LanguageServices.Implementation.Progression -{ - [ExportOptionProvider, Shared] - internal class ProgressionOptionsProvider : IOptionProvider - { - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public ProgressionOptionsProvider() - { - } - - public ImmutableArray Options { get; } = ImmutableArray.Create( - ProgressionOptions.SearchUsingNavigateToEngine, - ProgressionOptions.LegacySearchFeatureFlag); - } -} diff --git a/src/VisualStudio/Core/Test/Progression/SearchGraphQueryTests.vb b/src/VisualStudio/Core/Test/Progression/SearchGraphQueryTests.vb deleted file mode 100644 index 4641ed11ca716..0000000000000 --- a/src/VisualStudio/Core/Test/Progression/SearchGraphQueryTests.vb +++ /dev/null @@ -1,453 +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. - -Imports System.Threading.Tasks -Imports Microsoft.CodeAnalysis.Editor.Shared.Utilities -Imports Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces -Imports Microsoft.CodeAnalysis.Shared.TestHooks -Imports Microsoft.CodeAnalysis.Test.Utilities -Imports Microsoft.VisualStudio.GraphModel -Imports Microsoft.VisualStudio.LanguageServices.Implementation.Progression -Imports Roslyn.Test.Utilities - -Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Progression - - Public Class SearchGraphQueryTests - - Public Async Function SearchForType() As Task - Using testState = ProgressionTestState.Create( - - - - class C { } - - - ) - - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, False)) - Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) - Dim outputContext = Await testState.GetGraphContextAfterQuery( - New Graph(), New SearchGraphQuery(searchPattern:="C", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) - - AssertSimplifiedGraphIs( - outputContext.Graph, - - - - - - - - - - - - - - ) - End Using - End Function - - - Public Async Function SearchForNestedType() As Task - Using testState = ProgressionTestState.Create( - - - - class C { class F { } } - - - ) - - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, False)) - Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) - Dim outputContext = Await testState.GetGraphContextAfterQuery( - New Graph(), New SearchGraphQuery(searchPattern:="F", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) - - AssertSimplifiedGraphIs( - outputContext.Graph, - - - - - - - - - - - - - - - - ) - End Using - End Function - - - Public Async Function SearchForMember() As Task - Using testState = ProgressionTestState.Create( - - - - class C { void M(); } - - - ) - - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, False)) - Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) - Dim outputContext = Await testState.GetGraphContextAfterQuery( - New Graph(), New SearchGraphQuery(searchPattern:="M", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) - - AssertSimplifiedGraphIs( - outputContext.Graph, - - - - - - - - - - - - - - - - ) - End Using - End Function - - - Public Async Function SearchForPartialType() As Task - Using testState = ProgressionTestState.Create( - - - -Namespace N - Partial Class C - Sub Goo() - End Sub - End Class -End Namespace - - -Namespace N - Partial Class C - Sub Bar() - End Sub - End Class -End Namespace - - - ) - - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, False)) - Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) - Dim outputContext = Await testState.GetGraphContextAfterQuery( - New Graph(), New SearchGraphQuery(searchPattern:="C", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) - - AssertSimplifiedGraphIs( - outputContext.Graph, - - - - - - - - - - - - - - - - - ) - End Using - End Function - - - Public Async Function SearchForMethodInPartialType() As Task - Using testState = ProgressionTestState.Create( - - - -Namespace N - Partial Class C - Sub Goo() - End Sub - End Class -End Namespace - - -Namespace N - Partial Class C - Sub Bar() - End Sub - End Class -End Namespace - - - ) - - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, False)) - Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) - Dim outputContext = Await testState.GetGraphContextAfterQuery( - New Graph(), New SearchGraphQuery(searchPattern:="Goo", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) - - AssertSimplifiedGraphIs( - outputContext.Graph, - - - - - - - - - - - - - - - - ) - End Using - End Function - - - Public Async Function SearchWithResultsAcrossMultipleTypeParts() As Task - Using testState = ProgressionTestState.Create( - - - -Namespace N - Partial Class C - Sub ZGoo() - End Sub - End Class -End Namespace - - -Namespace N - Partial Class C - Sub ZBar() - End Sub - End Class -End Namespace - - - ) - - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, False)) - Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) - Dim outputContext = Await testState.GetGraphContextAfterQuery( - New Graph(), New SearchGraphQuery(searchPattern:="Z", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) - - AssertSimplifiedGraphIs( - outputContext.Graph, - - - - - - - - - - - - - - - - - - - - - ) - End Using - End Function - - - Public Async Function SearchForDottedName1() As Task - Using testState = ProgressionTestState.Create( - - - - class Dog { void Bark() { } } - - - ) - - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, False)) - Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) - Dim outputContext = Await testState.GetGraphContextAfterQuery( - New Graph(), New SearchGraphQuery(searchPattern:="D.B", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) - - AssertSimplifiedGraphIs( - outputContext.Graph, - - - - - - - - - - - - - - - - ) - End Using - End Function - - - Public Async Function SearchForDottedName2() As Task - Using testState = ProgressionTestState.Create( - - - - class Dog { void Bark() { } } - - - ) - - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, False)) - Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) - Dim outputContext = Await testState.GetGraphContextAfterQuery( - New Graph(), New SearchGraphQuery(searchPattern:="C.B", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) - - AssertSimplifiedGraphIs( - outputContext.Graph, - - - - ) - End Using - End Function - - - Public Async Function SearchForDottedName3() As Task - Using testState = ProgressionTestState.Create( - - - - namespace Animal { class Dog<X> { void Bark() { } } } - - - ) - - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, False)) - Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) - Dim outputContext = Await testState.GetGraphContextAfterQuery( - New Graph(), New SearchGraphQuery(searchPattern:="D.B", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) - - AssertSimplifiedGraphIs( - outputContext.Graph, - - - - - - - - - - - - - - - - ) - End Using - End Function - - - Public Async Function SearchForDottedName4() As Task - Using testState = ProgressionTestState.Create( - - - - namespace Animal { class Dog<X> { void Bark() { } } } - - - ) - - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, False)) - Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) - Dim outputContext = Await testState.GetGraphContextAfterQuery( - New Graph(), New SearchGraphQuery(searchPattern:="A.D.B", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) - - AssertSimplifiedGraphIs( - outputContext.Graph, - - - - - - - - - - - - - - - - ) - End Using - End Function - - - Public Async Function SearchWithNullFilePathsOnProject() As Task - Using testState = ProgressionTestState.Create( - - > - - namespace Animal { class Dog<X> { void Bark() { } } } - - - ) - - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, False)) - Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) - Dim outputContext = Await testState.GetGraphContextAfterQuery( - New Graph(), New SearchGraphQuery(searchPattern:="A.D.B", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) - - ' When searching, don't descend into projects with a null FilePath because they are artifacts and not - ' representable in the Solution Explorer, e.g., Venus projects create sub-projects with a null file - ' path for each .aspx file. Documents, on the other hand, are never allowed to have a null file path - ' and as such are not tested here. The project/document structure for these scenarios would look - ' similar to this: - ' - ' Project: SomeVenusProject, FilePath=C:\path\to\project.csproj - ' + Document: SomeVenusDocument.aspx, FilePath=C:\path\to\SomeVenusDocument.aspx - ' + Project: 1_SomeNamespace_SomeVenusDocument.aspx, FilePath=null <- the problem is here - ' + Document: SomeVenusDocument.aspx.cs - AssertSimplifiedGraphIs( - outputContext.Graph, - - - - ) - End Using - End Function - End Class -End Namespace diff --git a/src/VisualStudio/Core/Test/Progression/SearchGraphQueryTests_NavigateTo.vb b/src/VisualStudio/Core/Test/Progression/SearchGraphQueryTests_NavigateTo.vb index c109b45bd8e82..922e30c5f4970 100644 --- a/src/VisualStudio/Core/Test/Progression/SearchGraphQueryTests_NavigateTo.vb +++ b/src/VisualStudio/Core/Test/Progression/SearchGraphQueryTests_NavigateTo.vb @@ -25,7 +25,6 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Progression ) - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, True)) Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) Dim outputContext = Await testState.GetGraphContextAfterQuery( New Graph(), New SearchGraphQuery("C", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) @@ -59,7 +58,6 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Progression ) - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, True)) Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) Dim outputContext = Await testState.GetGraphContextAfterQuery( New Graph(), New SearchGraphQuery("F", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) @@ -93,7 +91,6 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Progression ) - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, True)) Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) Dim outputContext = Await testState.GetGraphContextAfterQuery( New Graph(), New SearchGraphQuery("M", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) @@ -140,7 +137,6 @@ End Namespace ) - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, True)) Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) Dim outputContext = Await testState.GetGraphContextAfterQuery( New Graph(), New SearchGraphQuery("C", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) @@ -191,7 +187,6 @@ End Namespace ) - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, True)) Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) Dim outputContext = Await testState.GetGraphContextAfterQuery( New Graph(), New SearchGraphQuery("Goo", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) @@ -238,7 +233,6 @@ End Namespace ) - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, True)) Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) Dim outputContext = Await testState.GetGraphContextAfterQuery( New Graph(), New SearchGraphQuery("Z", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) @@ -276,7 +270,6 @@ End Namespace ) - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, True)) Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) Dim outputContext = Await testState.GetGraphContextAfterQuery( New Graph(), New SearchGraphQuery("D.B", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) @@ -310,7 +303,6 @@ End Namespace ) - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, True)) Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) Dim outputContext = Await testState.GetGraphContextAfterQuery( New Graph(), New SearchGraphQuery("C.B", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) @@ -335,7 +327,6 @@ End Namespace ) - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, True)) Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) Dim outputContext = Await testState.GetGraphContextAfterQuery( New Graph(), New SearchGraphQuery("D.B", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) @@ -369,7 +360,6 @@ End Namespace ) - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, True)) Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) Dim outputContext = Await testState.GetGraphContextAfterQuery( New Graph(), New SearchGraphQuery("A.D.B", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom) @@ -403,7 +393,6 @@ End Namespace ) - testState.Workspace.SetOptions(testState.Workspace.Options.WithChangedOption(ProgressionOptions.SearchUsingNavigateToEngine, True)) Dim threadingContext = testState.Workspace.ExportProvider.GetExportedValue(Of IThreadingContext) Dim outputContext = Await testState.GetGraphContextAfterQuery( New Graph(), New SearchGraphQuery("A.D.B", threadingContext, AsynchronousOperationListenerProvider.NullListener), GraphContextDirection.Custom)