Support validation rule autocompletion in form requests #520
+95
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #291, #474
This adds support for autocompletion inside the
rulesmethod of form requests.Specifically, this implements the necessary logic to the completion registry for the
classExtendsandmethodDefinitionfields, which are already defined (but unused) in thetags()function of the validation completion provider.Note
I implemented this with the help of an AI agent (Claude Opus 4.5). I tested this and reviewed the code, which I deemed to be consistent with other parts in the completion provider.
Also, I corrected the completion template for the
afterrule, which was missing the template braces around the placeholder.Screenshots
Before:

After:
