Skip to content

Commit

Permalink
fix: methodmapper was not mapping methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Samir Boulema committed Feb 24, 2022
1 parent 6e3b3d4 commit 5a99826
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions CodeNav.Shared/Mappers/MethodMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,26 @@ public static class MethodMapper
public static CodeItem? MapMethod(MethodDeclarationSyntax? member,
ICodeViewUserControl control, SemanticModel semanticModel)
{
if (member == null ||
!(member.ReturnType is ITypeSymbol returnTypeSymbol))
if (member == null)
{
return null;
}

return MapMethod(member, member.Identifier, member.Modifiers,
member.Body, returnTypeSymbol, member.ParameterList,
member.Body, member.ReturnType as ITypeSymbol, member.ParameterList,
CodeItemKindEnum.Method, control, semanticModel);
}

public static CodeItem? MapMethod(LocalFunctionStatementSyntax member,
ICodeViewUserControl control, SemanticModel semanticModel)
{
if (!(member.ReturnType is ITypeSymbol returnTypeSymbol))
{
return null;
}

return MapMethod(member, member.Identifier, member.Modifiers,
member.Body, returnTypeSymbol, member.ParameterList,
member.Body, member.ReturnType as ITypeSymbol, member.ParameterList,
CodeItemKindEnum.LocalFunction, control, semanticModel);
}

private static CodeItem? MapMethod(SyntaxNode node, SyntaxToken identifier,
SyntaxTokenList modifiers, BlockSyntax? body, ITypeSymbol returnType,
SyntaxTokenList modifiers, BlockSyntax? body, ITypeSymbol? returnType,
ParameterListSyntax parameterList, CodeItemKindEnum kind,
ICodeViewUserControl control, SemanticModel semanticModel)
{
Expand Down

0 comments on commit 5a99826

Please sign in to comment.