You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of explicitly checking some specific folder and specific indices simply loop backwards from the filename to the create folder and check if one of the paths is a match.
Avoid the copy pasting of regex, and constant index out of bounds exceptions being thrown.
returnnode.Identifier.Span.ToSpan();//Evidently this create method isn't working for some reason - even though it should but this is as a protection/precaution
returnnull;//The folder path after the 'Create' folder matches the return type so this is valid. IsValidCreateMethodName will check if the method name matches the file name
73
-
}
74
-
catch
75
-
{
76
-
//In case createIndex + 1 || createIndex + 2 result in an out of bounds error - it means the check has failed and something isn't compliant so can pass through to returning the span
returnnull;//Name of file or folder matches return type exactly so this is valid. IsValidCreateMethodName will check if the method name matches the file name
77
68
}
78
69
}
79
70
returnnode.Identifier.Span.ToSpan();//Create method file (name/path) and return type do not match as required
0 commit comments