From 52365c4321dca410a58d436d46f2e2d1ddac02dd Mon Sep 17 00:00:00 2001 From: Jason Malinowski Date: Mon, 8 Apr 2019 21:29:34 -0400 Subject: [PATCH] Merge public and private overload The private overload was just used by the public one. Makes it easier to navigate if there's just less code. --- .../Extensions/SemanticModelExtensions.cs | 36 +++++++------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/SemanticModelExtensions.cs b/src/Workspaces/Core/Portable/Shared/Extensions/SemanticModelExtensions.cs index 6cf1c824dc3..ab783bf1059 100644 --- a/src/Workspaces/Core/Portable/Shared/Extensions/SemanticModelExtensions.cs +++ b/src/Workspaces/Core/Portable/Shared/Extensions/SemanticModelExtensions.cs @@ -73,26 +73,6 @@ public static INamespaceSymbol GetEnclosingNamespace(this SemanticModel semantic return typeInfo.Type ?? symbolInfo.GetAnySymbol().ConvertToType(semanticModel.Compilation); } - public static TokenSemanticInfo GetSemanticInfo( - this SemanticModel semanticModel, - SyntaxToken token, - Workspace workspace, - CancellationToken cancellationToken) - { - var languageServices = workspace.Services.GetLanguageServices(token.Language); - var syntaxFacts = languageServices.GetService(); - if (!syntaxFacts.IsBindableToken(token)) - { - return TokenSemanticInfo.Empty; - } - - var semanticFacts = languageServices.GetService(); - - return GetSemanticInfo( - semanticModel, semanticFacts, syntaxFacts, - token, cancellationToken); - } - private static ISymbol MapSymbol(ISymbol symbol, ITypeSymbol type) { if (symbol.IsConstructor() && symbol.ContainingType.IsAnonymousType) @@ -141,13 +121,21 @@ private static ISymbol MapSymbol(ISymbol symbol, ITypeSymbol type) return symbol; } - private static TokenSemanticInfo GetSemanticInfo( - SemanticModel semanticModel, - ISemanticFactsService semanticFacts, - ISyntaxFactsService syntaxFacts, + public static TokenSemanticInfo GetSemanticInfo( + this SemanticModel semanticModel, SyntaxToken token, + Workspace workspace, CancellationToken cancellationToken) { + var languageServices = workspace.Services.GetLanguageServices(token.Language); + var syntaxFacts = languageServices.GetService(); + if (!syntaxFacts.IsBindableToken(token)) + { + return TokenSemanticInfo.Empty; + } + + var semanticFacts = languageServices.GetService(); + IAliasSymbol aliasSymbol; ITypeSymbol type; ITypeSymbol convertedType; -- GitLab