diff --git a/src/Workspaces/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeInfo.cs b/src/Workspaces/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeInfo.cs index 11723f649b04a1f604d5e73cd5a8d971dd888648..939d8169c5bffb83625ef8155c2aa794842f0ea5 100644 --- a/src/Workspaces/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeInfo.cs +++ b/src/Workspaces/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeInfo.cs @@ -109,9 +109,17 @@ public static Task GetIdentifierInfoAsync(Document doc return GetInfoAsync(document, s_identifierSnapshotCache, SyntaxTreeIdentifierInfo.LoadAsync, tuple => tuple.Item1, cancellationToken); } - public static Task GetDeclarationInfoAsync(Document document, CancellationToken cancellationToken) + private static Func> s_loadAsync + = SyntaxTreeDeclarationInfo.LoadAsync; + private static Func, SyntaxTreeDeclarationInfo> s_getThirdItem + = tuple => tuple.Item3; + + public static Task GetDeclarationInfoAsync( + Document document, CancellationToken cancellationToken) { - return GetInfoAsync(document, s_declaredSymbolsSnapshotCache, SyntaxTreeDeclarationInfo.LoadAsync, tuple => tuple.Item3, cancellationToken); + return GetInfoAsync( + document, s_declaredSymbolsSnapshotCache, s_loadAsync, + s_getThirdItem, cancellationToken); } // The probability of getting a false positive when calling ContainsIdentifier.