Diagnostics do not get updated

Topics: APIs, General
Jan 7, 2015 at 6:59 AM
Hello, I am writing an analyzer which report diagnostics for unused private fields. The thing is that these diagnostics do not get updated each time. Imagine the following case:
I have some class and there is one and only member:
private string myString;
Now my analyzer will report that this field is not used. Then I am updating the class by adding the following method
public void UpdateMyString(string newString)
   this.myString = newString;
but the analysis is not triggered and the diagnostic does not disappear.
I tried registering both symbol and syntax actions with supported SymbolKind.Field and SyntaxKind.FieldDeclaration respectively but neither of them works for me. I realize that registering SyntaxTreeAction would work for this case but if the class is partial and I add the method in another file I assume that the analysis won't be triggered either.
Is there something that I am missing here? Any help would be appreciated!

Jan 12, 2015 at 7:59 PM
Without knowing more about how your analyzer is structured it is hard to know.

Are you registering syntax actions, symbol actions, or other kinds? What analysis are you doing to determine that myString is not used?