You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bean completion proposals] already having a field with the name of the bean causes weird results #1488
I think the best way to deal with this situation is to - of course - avoid the duplicated constructor - and to allow the user to easily switch to a different name for the injected bean. This could be done by popping up a dialog that asks the user for a different name or to activate a multi-part edit as part of the completion that pre-selects all the occurrences of the bean name (constructor param + field), so that the user can continue typing a different name and then continue.
I think the multi-part edit can be triggered by marking the completion as a snippet completion and include placeholders inside. Although not sure how this works across multiple edits in the same proposal (like the main edit and the additional edits). To be investigated...
I'd silently generate a different name for the field... Might be too much work for the edge case... IntelliJ doesn't treat this any better than us currently...
Activity
martinlippert commentedon Feb 28, 2025
I think the multi-part edit can be triggered by marking the completion as a snippet completion and include placeholders inside. Although not sure how this works across multiple edits in the same proposal (like the main edit and the additional edits). To be investigated...
BoykoAlex commentedon Feb 28, 2025
I'd silently generate a different name for the field... Might be too much work for the edge case... IntelliJ doesn't treat this any better than us currently...
martinlippert commentedon Feb 28, 2025
Yeah, okay, let's not spend too much time on this edge case for now. Can polish this later, if necessary.
BoykoAlex commentedon Feb 28, 2025
Generated unique name for the field: b0d42d1