Comments (3)
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.
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.
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)
- Support multiple binary targets in `rust-run` HOT 5
- A Redundant Window Is Created, After 'rustfmt'ed HOT 1
- Window configuration changes on format HOT 8
- no library targets found in package `current_project` HOT 6
- Feature Request: Support for flymake HOT 7
- Extra indentation on line that starts with dot and previous line is close parenthesis.
- rustic-cargo-upgrade doesn't work - no such command: `upgrade` HOT 2
- Please consider easier to type default keybindings for cargo actions
- Indentation messes up in incredibly specific condition. HOT 1
- Installation recipe does not work: Scan error: "Containing expression ends prematurely", 153, 154 HOT 4
- rust-mode deletes my custom main menu entries, in just about any mode HOT 1
- cargo expand fails when invoked from rust-mode of emacs in a project under a workspace HOT 1
- rust-mode only sparsely highlights code in Emacs 29.1 HOT 3
- C-c C-c C-t on a remote (tramp) file invokes cargo test on the local machine
- How to open document for the symbol under the cursor? HOT 1
- New version on NonGNU ELPA
- Integrating `rust-mode` with Built-in Tree-sitter in Emacs 29 HOT 2
- compilation-error-regexp not matching panics HOT 5
- Indentation issue HOT 3
- Native compilation warnings HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-mode.