Skip to content

Conversation

@Natural-selection1
Copy link
Contributor

@Natural-selection1 Natural-selection1 commented Nov 10, 2025

  1. Upgrade the level from generate to quickfix
  2. Expand the recognition scope to trigger whenever inconsistent lifetime parameters are found in ADT definitions (this often coincides with compilation errors)
  3. Enhance the original assist behavior (now allowing renaming and enabling the completion of all missing lifetime parameters internally), automatically supplementing the externally missing lifetime parameters in the generic parameters
  4. Rename to add_missing_lifetime

Operation 1: Supplement all existing lifetime declarations in the ADT
Operation 2: Add a lifetime to all references without one and declare it in the ADT (still leave markers for easy renaming)

References without lifetime exist All existing lifetimes declared in ADT Processing Method
No No Operation 1
Yes Yes Operation 2
No Yes Do not use this assist
Yes No First Operation 1, then Operation 2

before:

now.mp4

after:

add_missing_lifetime.mp4

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 10, 2025
@Natural-selection1
Copy link
Contributor Author

It should be possible to use add_group to let the user choose whether to use the same name as existing lifetimes (similar to how auto_import handles multiple paths). However, I'm not very familiar with this part and might need to study it further.

@Natural-selection1 Natural-selection1 changed the title Rewrite add_lifetime_to_type assist Rewrite add_lifetime_to_type to add_missing_lifetime Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants