Rubberduck icon indicating copy to clipboard operation
Rubberduck copied to clipboard

Provide a QuickFix for the ReadOnlyPropertyAssignment Inspection

Open BZngr opened this issue 2 years ago • 1 comments

The ReadOnlyPropertyAssignmentInspection (#5875) flags code that attempts to assign a property that only implements a Get member. If the user determines that Let/Set member(s) are appropriate, then RD has sufficient information to inject the new member(s) and possibly an implementation that (as a minimum) raises a 'Not Implemented' error.

One at a time: It may be best to have the CanFixMultiple flag set to false for this QuickFix. The decision to convert a read-only property to a read/write property is probably best made on a case-by-case basis.

Interfaces: For the initial implementation, we may want to withhold the QuickFix option if the flagged read-only property is an interface member. Otherwise, the QuickFix implementation will need to update both the interface definition module and all implementing modules.

BZngr avatar Oct 14 '21 21:10 BZngr

Reopening this issue as #6031 introduced code that the QuickFix would leverage - but not the QuickFix itself.

BZngr avatar Oct 25 '22 18:10 BZngr