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

Formatting misfire with anything following item macro call #527

Closed
udoprog opened this issue May 25, 2023 · 9 comments
Closed

Formatting misfire with anything following item macro call #527

udoprog opened this issue May 25, 2023 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@udoprog
Copy link
Collaborator

udoprog commented May 25, 2023

See: https://github.com/rune-rs/rune/actions/runs/5084802670/jobs/9137546952?pr=526#step:4:590

@udoprog udoprog added the bug Something isn't working label May 25, 2023
@udoprog
Copy link
Collaborator Author

udoprog commented May 25, 2023

It seems like anything following the macro call gets munched, even if it's a comment or a use.

@udoprog udoprog changed the title Formatting misfire with comment preceeding item macro call Formatting misfire with anything following item macro call May 25, 2023
@tgolsson
Copy link
Contributor

Is there just a missing \n? Or more destructive?

@udoprog
Copy link
Collaborator Author

udoprog commented May 25, 2023

It chomps away all newlines (one per fmt call) until there's no separation at all between items.

@tgolsson
Copy link
Contributor

I think this invocation needs to add a newline:

if let Some(semi) = semi {
self.writer.write_spanned_raw(semi.span, false, false)?;
}

So true, false as the whitespace args. Super-busy at the moment but might have some time to look more in-depth during the weekend.

@udoprog
Copy link
Collaborator Author

udoprog commented May 27, 2023

No worries. Just thought you'd be interested! Take your time or if you want, I can look into it.

@tgolsson
Copy link
Contributor

tgolsson commented Jun 3, 2023

Hmm, running locally I hit

error: Compile error
  ┌─ scripts/make_function.rn:3:5
  │
3 │     make_function!(inner_fn => { "Hello World Again!" });
  │     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Missing macro `make_function`

on latest main.
Using the same command as CI; cargo run --bin rune -- fmt --experimental --recursive --verbose --workspace --check tools scripts

@tgolsson
Copy link
Contributor

tgolsson commented Jun 3, 2023

Looks to be lookup order, though if I switch the import to the top it fails on the macro evaluation.

@udoprog
Copy link
Collaborator Author

udoprog commented Jun 3, 2023

Item expansion inside of functions has also* been temporarily disabled until I can figure out how to make it less messy. Try with the current version I just pushed.

I also have a pretty bad cold, so I might be checked out for a few more days.

@udoprog
Copy link
Collaborator Author

udoprog commented Jun 3, 2023

Closed in #539

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants