summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-04-11mention keybinding for rustfmtNiko Matsakis
2017-04-05fix syntax of "<" appearing after "?"Tom Tromey
The "<" syntax-setting code could be confused after a "?". This patch changes the code to treat "?" as an "ambiguous operator" and adjust according to further context. Fixes #200
2017-04-05Merge pull request #199 from tromey/open-paren-in-column-0Niko Matsakis
set open-paren-in-column-0-is-defun-start to nil
2017-03-19set open-paren-in-column-0-is-defun-start to nilTom Tromey
Set open-paren-in-column-0-is-defun-start to nil in rust-mode. This setting is a performance hack in Emacs, at the expense of correctness in some cases. However, due to the syntax-ppss cache, I doubt whether this hack is needed for Rust code. Fixes #107
2017-03-15Use syntax-propertize-function, not font-lock-syntactic-keywordsTom Tromey
font-lock-syntactic-keywords have been obsolete since Emacs 24.1, the earliest version supported by rust-mode. Instead, modes are encouraged to use syntax-propertize-function. syntax-propertize-function provides a generally better experience. Syntax propertization is not tied to font lock,so angle bracket matching will still work when font-lock is disabled. There's no longer a need to call font-lock-fontify-buffer or font-lock-ensure (you can see this in the tests). The resulting code is also shorter. I removed a few tests: * font-lock-raw-string-constant was written assuming font-lock based syntax propertization, but that's no longer the case. * font-lock-extend-region-in-string and rust-test-revert-hook-preserves-point both called functions that no longer exist. There's a fix for a hidden bug in rust-is-in-expression-context. This previously could signal in some situations, but the signal was hidden by font-lock. It was visible now when running tests, hence the new call to condition-case. I suspect this might fix #192, but I haven't tried it.
2017-03-14Don't use "&optional &rest"Tom Tromey
rust-mode-tests.el uses "&optional &rest" in some function signatures. This was never really correct, and newer versions of Emacs complain about it. &rest implies &optional, so removing &optional is all that is needed.
2017-01-17Merge pull request #190 from mrBliss/imenu-externNiko Matsakis
Recognize "extern" imenu items
2017-01-17Merge pull request #191 from Wooble/readme_linkFelix S Klock II
fix PR link in README
2017-01-12fix PR link in READMEGeoffrey Spear
2017-01-12Recognize "extern" imenu itemsmrBliss
Fixes #188.
2017-01-07Merge pull request #180 from MicahChalmer/melpa-stable-readmeNiko Matsakis
Add instructions for version tag update requests
2017-01-07Merge pull request #175 from mrBliss/imenu-unsafeNiko Matsakis
Recognize imenu items starting with "unsafe"
2017-01-07Merge pull request #187 from tspiteri/format-other-buffersNiko Matsakis
handle indirect buffers and multiple windows in rust-format-buffer
2017-01-07Merge pull request #189 from froydnj/minor-cleanupsNiko Matsakis
minor cleanups: https links and defcustom grouping
2017-01-06convert http links into https linksNathan Froyd
2017-01-06put remaining defcustoms into the rust-mode groupNathan Froyd
2016-12-25improve position recovery in rust-format-bufferTrevor Spiteri
2016-12-22handle indirect buffers and multiple windows in rust-format-bufferTrevor Spiteri
2016-11-01Add instructions for version tag update requestsMicah Chalmer
2016-11-01Merge pull request #178 from ryuslash/masterMicah Chalmer
Bump version - this commit will also be added as a version tag.
2016-10-27Bump versionTom Willemse
2016-10-25Merge pull request #177 from mrBliss/handle-comments-method-chainsNiko Matsakis
Handle comments when indenting method chains
2016-10-22Handle comments when indenting method chainsmrBliss
Previously, indentation went wrong when the comment on the line above looked like a method call/member access: fn main() { // Lorem ipsum lorem ipsum lorem ipsum lorem.ipsum foo.bar() } With this patch: fn main() { // Lorem ipsum lorem ipsum lorem ipsum lorem.ipsum foo.bar() } Also, a blank line or a comment broke method-chain indentation: fn main() { something.a.do_it // A comment .aligned .more_alignment(); } With this patch: fn main() { something.a.do_it // A comment .aligned .more_alignment(); } Note that comments interleaving a method chain are not aligned with the '.' of the method chain.
2016-10-19Recognize imenu items starting with "unsafe"mrBliss
2016-09-27Add info to enable rustfmtnokaa
2016-09-09Merge pull request #169 from mrBliss/fix-168Niko Matsakis
Fix #168: use while in rust-rewind-irrelevant
2016-09-09Test #169mrBliss
Before applying #169 the new test fails with a stack overflow, with #169 it passes.
2016-09-09Fix #168: use while in rust-rewind-irrelevantmrBliss
Rewrite the recursive function `rust-rewind-irrelevant`, which causes a stack overflow in #168, using a `while` loop.
2016-08-20Merge pull request #165 from nikomatsakis/new-errorsNiko Matsakis
fix regex to account for `[E123]`
2016-08-18Merge pull request #163 from Wilfred/preserve_point_rustfmtNiko Matsakis
Correctly restore point position after running rustfmt
2016-08-15fix regex to account for `[E123]`Niko Matsakis
2016-08-02Go back to the current line and column after formatting.Wilfred Hughes
The previous approach simply moved to the same character offset. This is unlikely to preserve the position of point, as rustfmt often changes whitespace, changing the number of characters before point. Instead, we go back to the line number and column number we were on before. Provided that rustfmt has not radically changed the number of lines, this will typically put point back to its previous position, or at least close. Improves, but doesn't completely solve, issue #162.
2016-08-02rust--after-revert-hook should preserve point position.Wilfred Hughes
Otherwise, rust-format-buffer always moves point to the end of the buffer.
2016-07-26Merge pull request #159 from hotpxl/masterNiko Matsakis
[master] Copy buffer only when format changes.
2016-07-21Merge pull request #161 from Fanael/masterNiko Matsakis
Fix #160
2016-07-21[master] Remove redundant progn.Yutian Li
2016-07-19Fix #160Fanael Linithien
Use `font-lock-fontify-region` on the whole buffer to actually force refontification in Emacs 24, which does not support `font-lock-ensure`. `font-lock-fontify-buffer` is actually closer to `font-lock-flush`, so it's not the right function to use in `rust--after-revert-hook`.
2016-07-16[master] Copy buffer only when format changes.Yutian Li
2016-05-17Merge pull request #157 from fmdkdd/masterNiko Matsakis
Improve imenu support
2016-05-14Add menu titles for items in imenufmdkdd
All items gathered by imenu were put at the top-level, except impls. This commit puts all items in separate menu titles, following "Impl". Fixes #93.
2016-05-14Add macro_rules names to imenufmdkdd
imenu did not register macros previously. We must add `!` to the `word` syntax category for imenu since we reuse the `rust-re-item-def-imenu` regexp which use word boundaries.
2016-05-14imenu: don't add item defs in single-line commentsfmdkdd
Fixes #94. This commit changes the regexp used to build `rust-imenu-generic-expression` to strictly match item definitions on lines that are not single-line comments.
2016-05-06Merge pull request #154 from nikomatsakis/new-errorsMicah Chalmer
add code to handle new-style rustc errors
2016-05-04add code to handle new-style rustc errorsNiko Matsakis
These errors are available on nightly builds (or will be soon), but only (at the moment) when enabled via environment variable. They will become the default at some point in the future. In this commit we match on the `-->`, but after that we have to scroll the compilation window to make the error visible. One shortcoming is that if you enter the window and click on the filename/line-number, then the "next-error-hook" doesn't seem to run. (If you click at the start of the line, it does.) It may be possible to tweak the "hyperlink" here to make that work more smoothly, or perhaps add a hook somewhere else.
2016-04-26Merge pull request #153 from mrBliss/fix-151Micah Chalmer
Fix #151
2016-04-25Properly fix #151mrBliss
Always check whether we're not in a string or comment when looking for the `where` keyword. Use two helpers for this: `rust-looking-at-where` and `rust-rewind-to-where`.
2016-04-24Fix #151mrBliss
When looking for a `where` in `rust-rewind-to-beginning-of-current-level-expr`, check that it is not part of a string or comment.
2016-04-12Merge pull request #148 from bmastenbrook/masterNiko Matsakis
Fill regular block comments correctly
2016-04-06Fix for emacs24Brian Mastenbrook
2016-04-06Fix failing tests, and add a test for the fix.Brian Mastenbrook