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

cfg macro indentation off #4913

Closed
pickfire opened this issue Jul 20, 2021 · 1 comment
Closed

cfg macro indentation off #4913

pickfire opened this issue Jul 20, 2021 · 1 comment

Comments

@pickfire
Copy link

pickfire commented Jul 20, 2021

https://github.com/helix-editor/helix/pull/464/files#diff-d9796de334de9f547d45fd8b7476be53c771200ab48f28266e5f62e3493b5df9R171

            #[cfg(not(windows))]
            tokio::select! {
                biased;

                event = reader.next() => {
                    self.handle_terminal_events(event)
                }
                Some(signal) = self.signals.next() => {
                    use helix_view::graphics::Rect;
                    match signal {
                        signal::SIGTSTP => {
                            self.restore_term().unwrap();
                            low_level::emulate_default_handler(signal::SIGTSTP).unwrap();
                        }                        signal::SIGCONT => {

Noticed the last line. It seemed to happen for quite a few }.

Playground link for a similar example. https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=ff949fb617c3b00730fe0c2f06f4bcaa

@calebcartwright
Copy link
Member

Thanks for sharing, but rustfmt has never supported formatting inside macro calls that use brace delimiters. On calls with paren and bracket delimiters rustfmt can only format if the params are valid rust code. Formatting support for the arbitrary/not-valid-Rust-code content (much more common with brace delim usage, hence the no formatting) is a non-trivial problem that's yet to be resolved, and that large bucket of work is being tracked under #8

Closing this accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants