icsharpcode / NRefactory

NRefactory - Refactoring Your C# Code
684 stars 262 forks source link

ELiminated KeyValuePair from previous analyzer #488

Closed Kavignon closed 9 years ago

Kavignon commented 9 years ago

The TryDiagnostics method was modified in a way to directly evaluate the this expression within a lock statement with the helper boolean method ValidateLockStatementUsesThisExpression.

In a situation where the arguments in the attribute are delimited with a binary expresison syntax, the recursion method FindMemberAccessExpressionLocationWithinBinaryExpression was developped to find the location a member access expression.

IsSynchronizedEnumValueBeingUsed boolean method was created to make sure of the enum and the value of the enum inside the member access expression.

Kavignon commented 9 years ago

the text span comes from the getLocation method. When the location is being access, since I did not get the good Location. But I don't know where I should get the location from. Right now, with my new code, that's the only thing that is missing in my algorithm.