Skip to content

Highlight matching angle brackets #23

@Munksgaard

Description

@Munksgaard

We have some structs with very long nested types:

type SqrtCli<R, S, T> =
    Choose<Eps,
    Choose<R,
    Choose<S,
    Choose<Send<f64, Offer<Recv<f64, Var<Z>>, Var<Z>>>,
    T>>>>;

It would be very nice to have the syntax highlightingin rust-mode work for angle brackets as well --- as in, highlighting matching delimiters --- since it is a pain to keep track of them yourself. This goes for type parameters in functions, structures, impls and traits as well.

I realize that the problem is to parse < and > differently whether they're used as delimiters or simple less-than/greater-than signs --- a problem that the rustc parser has as well --- but this is something that would help us tremendously. I'm not very familiar with writing indentation modes but if there's any way I can help, please let me know.

It'd probably also be desirable for rust-mode to be able to indent type parameters properly, but the above code isn't the best example of how to do that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions