Commit Graph

89 Commits

Author SHA1 Message Date
gamazeps
e543878f0f Replaced some TODO by FIXME
closes #17478
2014-09-29 18:14:28 +02:00
Huon Wilson
d1c5db326f Add new keywords (particularly where & virtual) to editor modes. 2014-08-17 11:57:22 +10:00
Tom Jakubowski
23a7d24dd7 emacs: Remove outdated references to ~ in tests 2014-06-17 16:42:42 -07:00
Tom Jakubowski
77b874b68d emacs: Add shebang to test script 2014-06-17 16:39:40 -07:00
Tom Jakubowski
9175326272 emacs: Don't overwrite font lock for attributes
This addresses the font lock regression introduced by the earlier pull
request #14818 - attributes are no longer be highligted inside of comments
and strings.

Also add some font lock test infrastructure and some tests for attribute
font locking.
2014-06-17 16:38:19 -07:00
bors
feb294ca11 auto merge of #14818 : tomjakubowski/rust/emacs-attributes-key-value, r=pnkfelix
This addresses two problems noted in #14347: the highlight of `#foo]` as an attribute, and the non-highlight of `#[foo = "bar"]`.
2014-06-17 08:16:27 +00:00
Brian Anderson
f4ae8a83f9 Update repo location 2014-06-16 18:16:36 -07:00
Tom Jakubowski
e5baf1d94a emacs: highlight #[foo = "bar"] attributes
Setting `OVERRIDE` to `t` overrides the conflicting highlight Emacs
places on string literals.

Fix #14347
2014-06-11 05:06:51 -07:00
Tom Jakubowski
fca57b3aee emacs: do not highlight #foo] as an attribute
part of #14347
2014-06-11 05:01:16 -07:00
Huon Wilson
13491dbadb emacs: highlight macro_name! in macro invocations using [] delimiters 2014-05-12 19:52:29 -07:00
bors
edae0bdabf auto merge of #13922 : Rufflewind/rust/patch-1, r=pnkfelix
Since rust-top-item-beg-re hasn't been defined yet, using defvar instead of
setq is more appropriate here (and also silences compilation warnings).
2014-05-12 03:36:53 -07:00
Phil Ruffwind
7e53af35b1 Recommend autoload instead of require
Lazy loading with autoload will result in faster startup time for Emacs
users and is generally the recommended approach for major modes.
2014-05-03 16:36:54 -04:00
Phil Ruffwind
77c56f7ceb Use defvar for rust-top-item-beg-re instead
Since rust-top-item-beg-re hasn't been defined yet, using defvar instead of
setq is more appropriate here (and also silences compilation warnings).
2014-05-03 15:45:55 -04:00
Brian Anderson
a67307e2a5 emacs: Add 'box' to keywords 2014-05-02 23:00:10 -07:00
Rüdiger Sonderfeld
3a709761a5 rust-mode cleanup.
* Use `setq-local' instead of (set (make-local-variable ...) value).
  Provides a version for older Emacsen.
* Remove use of `cl.el'.
* Use \' in file regexp instead of line end match $.
* Use type for defcustom and add parent group.
2014-04-09 20:32:02 +02:00
Corey Richardson
b6d5dafea5 etc: attempts at fixing editor highlighting for new attribute syntax 2014-04-04 00:53:23 -04:00
Felix S. Klock II
1a1c47b918 Update emacs mode to support new #![inner(attribute)] syntax. 2014-04-03 13:43:40 -07:00
Micah Chalmer
d28d5b7fb4 Emacs: always jump the cursor if needed on indent
The rust-mode-indent-line function had a check, which ran after all the
calculations for how to indent had already happened, that skipped
actually performing the indent if the line was already at the right
indentation.

Because of that, the cursor did not jump to the indentation if the line
wasn't changing.  This was particularly annoying if there was nothing
but spaces on the line and you were at the beginning of it--it looked
like the indent just wasn't working.

This removes the check and adds test cases to cover this.
2014-03-12 15:01:25 -07:00
Micah Chalmer
d92fdb27cb Emacs: Remove README warning of old whitespace bug
The incompatibility of rust-mode with global-whitespace-mode warned
about in the README was actually fixed by commit 581b3db3b3.  Remove the
warning from the README and close #3994.
2014-03-02 22:02:18 -05:00
Micah Chalmer
04dc3e4985 Fix typo in emacs ERT test 2014-02-22 23:35:33 -05:00
Micah Chalmer
55b3c1917f Emacs: indent relative to enclosing block
This changes the indent to calculate positions relative to the enclosing
block (or braced/parenthesized expression), rather than by an absolute
nesting level within the whole file.  This allows things like this to
work:

    let x =
        match expr {
            Pattern => ...
        }

With the old method, only one level of nesting would be added within the
match braces, so "Pattern" would have ended up aligned with the match.

The other change is that multiple parens/braces on the same line only
increase the indent once.  This is a very common case for passing
closures/procs.  The absolute nesting method would do this:

    spawn(proc() {
            // Indented out two indent levels...
    })

whereas the code in this commit does this:

    spawn(proc() {
        // Indented out only one level...
    })
2014-02-22 23:06:46 -05:00
Micah Chalmer
45008f9b3e Emacs: stay at the correct position when indenting
When indenting a non-blank line, stay at the same cursor position
relative to the content after indenting.
2014-02-22 22:55:30 -05:00
Micah Chalmer
7fbcda1c65 Fix emacs indentation of multi-line match patterns
Aligns to the same column if the previous line ends in a single '|' (but
not a '||').
2014-02-22 13:11:48 -05:00
Derek Guenther
b609d57b02 Added more scripts to tidy check 2014-02-17 10:36:47 -06:00
Alex Crichton
a41b0c2529 extern mod => extern crate
This was previously implemented, and it just needed a snapshot to go through
2014-02-14 22:55:21 -08:00
Kevin Ballard
fff12220af Add crate to emacs and kate modefiles 2014-02-14 14:37:07 -08:00
John Louis Walker
8271ba8239 Fix rust-align-to-expr-after-brace, closes #11239.
forward-to-word is undefined, and so Emacs would throw errors in
rust-align-to-expr-after-brace. This change yields the expected
behavior discussed in the issue.
2013-12-31 14:19:36 -05:00
Micah Chalmer
d7c949368c Add "proc" as keyword to emacs mode 2013-12-14 18:00:21 -05:00
S Pradeep Kumar
04d852aeb1 Add defun motions for rust-mode.
Specifically, we can now use:
+ beginning-of-defun
+ end-of-defun
+ mark-defun

where "defun" means a Rust item.

+ Add tests in rust-mode-tests.el
+ Fix indentation in rust-mode-tests.el
+ Add support for trait to Imenu
2013-12-09 14:36:56 +09:00
S Pradeep Kumar
48b289fec4 Add Imenu support for rust-mode.
+ Delete trailing whitespace.
2013-12-04 19:04:47 +09:00
Micah Chalmer
5d24a1ae45 Fix single-line-style paragraph fills with code immediately before or after 2013-09-28 17:40:24 -04:00
Brian Anderson
c1d64297f0 Add 'continue' keyword to emacs, vim, gedit, kate 2013-09-26 15:04:43 -07:00
Lindsey Kuper
462dcc8e7a Minor cleanup and formatting tweaks to the rust-mode README 2013-09-13 20:46:41 -04:00
Micah Chalmer
a4697342f7 Cover all cases for padding in paragraph fills as intended 2013-09-07 00:39:38 -04:00
Micah Chalmer
be4f19ae7c Fix regression of multi-line statement indents 2013-09-07 00:38:23 -04:00
Micah Chalmer
fcf18786b4 Add ERT tests 2013-09-06 01:02:20 -04:00
Micah Chalmer
377b2c77e4 Add paragraph fill and auto-fill for multi-line comments 2013-09-06 01:02:20 -04:00
Micah Chalmer
1ac7c5cc5a Add custom group for rust-mode 2013-09-06 01:02:20 -04:00
Micah Chalmer
76e95a0264 Indent return type to align with arguments 2013-09-06 01:02:19 -04:00
Micah Chalmer
9ef0b9c0d6 Allow indenting to align struct fields after curly brace 2013-09-06 01:02:19 -04:00
Micah Chalmer
1c527dfcd4 Indent correctly after opening square bracket 2013-09-06 01:02:19 -04:00
Micah Chalmer
e7d5af8ec7 Fix glitches with struct field aligned indents 2013-09-05 22:18:29 -04:00
Micah Chalmer
7a42dd8074 Align field names in struct expressions with fields on same line as the opening curly brace 2013-08-30 02:04:08 -04:00
Micah Chalmer
70bc1637b8 Multiline comments with leading *s line up the *s 2013-08-30 02:04:01 -04:00
Micah Chalmer
0b9dc80d49 One indent after open paren with no argument 2013-08-29 23:28:36 -04:00
Micah Chalmer
20def31768 Correct indent with trailing spaces/comments on previous line 2013-08-29 23:12:08 -04:00
Anders Kaseorg
60e84809f0 rust-mode: Default rust-indent-offset to 4, not default-tab-width
default-tab-width is standardly 8, but most programmers and style
guides prefer an indentation width smaller than that.  Rust itself
uses 4 space indents.  Most other Emacs modes define the indentation
width as 4 or 2 spaces, independently of the width of a Tab character.
Depending on default-tab-width makes especially little sense for
rust-mode because it sets indent-tabs-mode to nil.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2013-08-28 18:09:02 -04:00
Felix S. Klock II
1f13eab3c0 fix typo in rust-mode.el 2013-08-27 12:48:51 +02:00
Felix S. Klock II
9d8897ba60 extend file regexp to match files with embedded spaces. 2013-08-26 02:28:27 +02:00
Felix S. Klock II
fe7092dafb revisions to emacs compilation regexp, more readable and robust. 2013-08-25 14:38:12 +02:00