Before this fix, we will add the FixIt before the type name:
^(NSView view) to ^(*NSView view)
After this commit, fixit will change it to ^(NSView* view).
Differential D20844
FixIt: use getLocForEndOfToken to insert fix-it after a type name. manmanren on May 31 2016, 4:44 PM. Authored by
Details Before this fix, we will add the FixIt before the type name: After this commit, fixit will change it to ^(NSView* view).
Diff Detail
Event TimelineComment Actions Hmm. No, I think the original code is correct here — RangeEnd is a token range, and those are generally inclusive rather than exclusive. The fix-it needs to be inserting at the end of the token. Comment Actions We currently insert the fix-it here And we call "TL.setNameEndLoc(DS.getLocEnd());" for ObjCInterfaceTypeLoc. The problem is that for annotation token, both the start and the end point to the same location. With "DS.SetRangeEnd(Tok.getAnnotationEndLoc());", the DeclSpec has the same start and end location. Is there a way to get the real end of the annotation token, since getAnnotationEndLoc returns the start location? Thanks, Comment Actions Use getLocForEndOfToken to insert fix-it after a type name instead of setting DeclSpec's range end. |