Rubberduck
Rubberduck copied to clipboard
Provide a QuickFix for the ReadOnlyPropertyAssignment Inspection
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.
Reopening this issue as #6031 introduced code that the QuickFix would leverage - but not the QuickFix itself.