How do I get the current value of a given variable name when writing a Roslyn Analyser?
Clash Royale CLAN TAG #URR8PPP How do I get the current value of a given variable name when writing a Roslyn Analyser? The following code snippet is the code I wish to analyse: var name = "Michael"; name = "John"; var person = new Person(name); And let's say my analyser should complain if the length of name given to the constructor of Person is less than 5. name constructor Person I know how to get the value of a string literal var person = new Person("John") that is passed in to this object creation expression, check the first arguments type and then if it's a string literal grab it's Value property. var person = new Person("John") Value But how do I get the analyser to give me the value of name at the Person object creation expression site. This name is clearly well defined in the code, so should be possible in this case. name Person name Thus far I've tried something along the lines of... var nameExpr = (IdentifierNameS...