Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use 4 spaces for indentation in macro expansion #16690

Merged
merged 4 commits into from Mar 4, 2024

Conversation

roife
Copy link
Contributor

@roife roife commented Feb 27, 2024

Partial fix for #16471.

In the previous code, the indentation produced by macro expansion was set to 2 spaces. This PR modifies it to 4 spaces for the sake of consistency.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 27, 2024
body.syntax()
.descendants_with_tokens()
.filter_map(NodeOrToken::into_token)
.filter(|tok| tok.kind() == SyntaxKind::SELF_KW)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That approach won't work, as self can also refer to the current module

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I forgot the other semantics of self 😱

@Veykril
Copy link
Member

Veykril commented Feb 27, 2024

I don't think we can do much about 1. right now as our search infra is just not built in a way that allows to search like that

@Veykril Veykril added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 27, 2024
@roife roife changed the title fix: better handling of macro expansion in inline_call fix: use 4 spaces for indentation in macro expansion Feb 27, 2024
@roife
Copy link
Contributor Author

roife commented Feb 27, 2024

I agree that replacement of self keyword is non-trivial since it may refer the 'current module'. I have changed the title and the description of this PR.

@roife roife requested a review from Veykril February 27, 2024 13:05
@roife
Copy link
Contributor Author

roife commented Mar 4, 2024

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 4, 2024
@Veykril
Copy link
Member

Veykril commented Mar 4, 2024

Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Mar 4, 2024

📌 Commit 76b86b2 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Mar 4, 2024

⌛ Testing commit 76b86b2 with merge 0b7d4cc...

@bors
Copy link
Collaborator

bors commented Mar 4, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 0b7d4cc to master...

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.

None yet

4 participants