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
Skip formatting the signature of a function when --file-lines does not overlap with the signature. Mostly fixes#6864. There's still a small edge case here where selecting the opening brace of the function will format the entire function signature, but I think the only way to handle that is to support partially formatting the signature, which is tracked by #6868.
Actually I think the fix should go a bit deeper than what I have here currently. I think the out_of_file_lines_range! check should probably go in rewrite_fn_base that way it also covers required fns in trait defs. I'm digging into it a bit more to see if doing it that way causes any problems.
Ah, moving the out_of_file_lines_range! check into rewrite_fn_base wouldn't actually impact trait definitions because we already have a similar check in visit_assoc_item that is skipping formatting of unselected trait items. We do eventually need to thread the file-lines info into rewrite_fn_base in order to fix #6868, but I think what I have in this PR is reasonable to cover the case of formatting the contents of a function without formatting its signature.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S-waiting-on-reviewStatus: awaiting review from the assignee but also interested parties.
2 participants
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.
Skip formatting the signature of a function when
--file-linesdoes not overlap with the signature. Mostly fixes #6864. There's still a small edge case here where selecting the opening brace of the function will format the entire function signature, but I think the only way to handle that is to support partially formatting the signature, which is tracked by #6868.