Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit cd9a090

Browse files
committed
Strip "I" from type name when generating a variable name.
1 parent 92c3786 commit cd9a090

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateMethodDeclarationAction.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,10 @@ internal static string GuessNameFromType(IType returnType)
363363
case "System.Action":
364364
return "action";
365365
}
366-
return returnType.Name;
366+
if (returnType.Kind == TypeKind.Interface && returnType.Name.StartsWith("I", System.StringComparison.Ordinal))
367+
return returnType.Name.Substring(1);
368+
else
369+
return returnType.Name;
367370
}
368371

369372
string GetMethodName(InvocationExpression invocation)

0 commit comments

Comments
 (0)