GithubHelp home page GithubHelp logo

Comments (3)

strega-nil avatar strega-nil commented on July 30, 2024

The second issue is one with (backward-up-list) in (rust-mode-indent-line), after
(rust-rewind-irrelevant):

mod test |2| {
    fn test|3|<A,|1|
               V>() {

The cursor goes from |1| to |2|, when it should go from |1| to |3|.

With issue 1, <> is not recognized as a paren-level by (rust-paren-level)

from rust-mode.

MicahChalmer avatar MicahChalmer commented on July 30, 2024

To make backward-up-list go where it should, emacs would have to recognize the < and > angle brackets as parentheses in its syntax table. In theory it's possible to do it perfectly, since rust's grammar does not require you to know the symbol table to make this distinction (unlike C++.)

I've been trying to get it to do just that recognizing angle brackets but not mistaking other < and > characters (return type arrows, match arrows, less than and greater than operators, etc). At this point I have something that almost works. Under normal circumstances it fixes this issue. It also makes the normal paren matching modes work on them without the code to simulate it that's there now (taking care of #50 in the process.)

Unfortunately at this point there are still a few cases where it gets the angle bracket identification wrong. The other problem with the patch as I currently have it is performance--on my machine, it makes emacs grind to a halt on even moderately large source files (at 7637 lines, src/librustc/middle/ty.rs from the rust tree is enough to make it freeze for minutes.) If anyone is curious I can put it up as an incomplete work-in-progress PR, but it's not ready for merging yet.

from rust-mode.

gsingh93 avatar gsingh93 commented on July 30, 2024

Is this related to the following indentation problem, or should I make a new issue:

if true
    || false {
        // Wrong indentation
    }

from rust-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.