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

emacs mode indentation is wrong when function return -> is on its own line #13566

Closed
nikomatsakis opened this issue Apr 16, 2014 · 5 comments
Closed

Comments

@nikomatsakis
Copy link
Contributor

The following code indents as shown here, which is weird:

pub fn from_pointer_kind(base_mutbl: MutabilityCategory,
                         ptr: PointerKind)
                         -> MutabilityCategory {
                             match ptr {
                             }
                         }

I expect it to be:

pub fn from_pointer_kind(base_mutbl: MutabilityCategory,
                         ptr: PointerKind)
                         -> MutabilityCategory {
    match ptr {
    }
}
@nikomatsakis
Copy link
Contributor Author

cc @pnkfelix @ruediger

@ruediger
Copy link
Contributor

Since you cc'ed me: I didn't really look at the indentation code. I think it would be best to throw it out and use GNU Emacs' SMIE instead. But I currently don't have the time or inside knowledge of the rust syntax to work on that. See (info "(elisp) SMIE").

@nikomatsakis
Copy link
Contributor Author

@ruediger I've no opinion about this. Our current indentation setup seems to work pretty well, but it certainly has a few minor flaws, and maybe rebasing atop SMIE might be better.

@huonw
Copy link
Member

huonw commented May 8, 2014

cc #8793

@huonw huonw changed the title emacs mode indentation is wrong for methods emacs mode indentation is wrong when function return -> is on its own line Nov 4, 2014
@steveklabnik
Copy link
Member

Moved to rust-lang/rust-mode#8

matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this issue Nov 16, 2022
flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 7, 2024
Fix version for `ref_option`

Close rust-lang#13566
As mentioned at rust-lang#13566 `ref_option` [was merged](rust-lang/rust-clippy#13336) after 1.82.0 so it wasn't include in this version

changelog: none
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

4 participants