summaryrefslogtreecommitdiff
path: root/rust-mode-tests.el
AgeCommit message (Collapse)Author
2021-04-23test: Suppress some noisy messagesJonas Bernoulli
2021-04-23Remove "-face" suffix from names of facesJonas Bernoulli
As mentioned in (info "(emacs)Defining Faces") the name of a face > should not end in "-face" (that would be redundant). For historic reasons a few built-in faces actually do end with "-face" and it so happens that our faces are closely related to just those `font-lock' faces and that probably inspired our use of the suffix. Even so, we should stop now.
2020-06-18compile-mode integration: add link to code references. (#391)Nathan Moreau
This allows to jump to code references such as lines 82 and 132 in the following snippet error message. error[E0061]: this function takes 1 parameter but 2 parameters were supplied --> file6.rs:132:34 | 82 | fn duration_ms_since(time: &Option<SystemTime>) -> u128 { | ------------------------------------------------------- defined here ... 132 | self.total_time_ms = duration_ms_since(&self.program_start, 2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-06-03rustc-colon-compilation-regexps: improve highlighting.Nathan Moreau
2020-05-28Add missing ‘require’ form.Philipp Stephani
‘compilation-face’ is defined in the ‘compile’ library, so we should ‘require’ that library.
2020-05-17Fix various byte compilation warnings in rust-mode-tests.el.Philipp Stephani
- Migrate to lexical binding. - Declare functions that are conditionally-defined. - Migrate off the deprecated ‘cl’ library. - Don’t use ‘setq’ to introduce global variables and constants. - Avoid “unused lexical variable” warnings. - Remove some unused variables. - Stop using interactive-only commands.
2020-05-13Re-implement rust-in-macro for performancePhillip Lord
rust-in-macro could cause significant performance problems resulting in a very choppy user experience. Reimplement rust-in macro in a somewhat simpler manner and in way which allows both allows restriction to parts of the buffer and caching of buffer analysis. Optimize rust-syntax-propertize to use this caching mechanism. Fixes #208 Fixes #288
2020-04-27Fix typosJonas Bernoulli
2020-04-12rustc-compilation-regexps: handle `note` case as compilation-info.Nathan Moreau
2019-12-08imenu: fn items: match async/const and all pub variants. (#346)Nathan Moreau
2019-11-18rust-insert-dbg: handle the case of string literals. (#342)Nathan Moreau
2019-11-08rust-dbg-wrap-or-unwrap: bind to C-c C-d rather than C-c d.Nathan Moreau
see `Key Binding Conventions' in the Emacs manual.
2019-10-31Add a function wrap and unwrap with the dbg! macro.Roey Darwish Dror
2019-10-31electric-pair-mode: prevent self-insert of `>' when already inserted. (#337)Nathan Moreau
2019-10-27Adding GitHub actions.Nathan Moreau
2019-10-23subword-match for built-in formatting macros: add a test.Nathan Moreau
2019-10-18Fix rustc-compilation-regexps: match error messages with dashes. (#331)Nathan Moreau
2019-10-10Highlight variable name in a for-loop (#326)Konstantin Kharlamov
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-10-01rust-mode.el: check for possible space between variable name and type (#325)Konstantin Kharlamov
Fixes the following problem: consider code fn foo(a: u32, b : u32) {} Here, `b` was not highlighted as a variable, because the regex didn't take into account possible space before the colon. Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-28Don't set indent-tabs-mode. (#324)Nathan Moreau
2019-04-16Add test for word boundaries for string ending with r.Evgeny Kurnevsky
2019-03-01Reverted back to font-lock-fontify-bufferMiodrag Milenkovic
because emacs 24 doesn't know about font-lock-ensure
2019-03-01Added angle bracket tests, some of which fail without the fixMiodrag Milenkovic
2019-03-01Replaced font-lock-fontify-buffer with font-lock-ensureMiodrag Milenkovic
2019-01-15Add rust-indent-return-type-to-arguments variableDavid Kellum
This preserves as default (t), the current indentation behavior of `-> ReturnType` when found on its own line: indenting as per the arguments of the above function. When disabled (nil) by the user, however, this will now just indent such a line one level from base-line (e.g. no special treatment). Includes a basic test.
2018-12-18imenu: handle lifetimes in impl blocks.Nathan Moreau
2018-06-07Fix font-locking of "let ref"Tom Tromey
Fixes #271
2018-02-15Fixed indent when ? operator is used in chained method callsJonas Westlund
2018-02-15Merge pull request #253 from jjwest/masterNiko Matsakis
Improved font-locking for print macros
2018-01-09Do not indent where clause by default (follow standard) #257Sebastien Chapuis
2017-12-08Improved font-locking for print macrosJonas Westlund
2017-09-14Remove `float`, `int`, and `uint` as built-in types.Jake Goulding
These went away pre Rust-1.0 and are valid identifiers. Went ahead and removed them from the tests as well, replacing them with real types of the same number of characters.
2017-08-21Renamed and relocated if-let font-lock testJonas Westlund
2017-08-21Added test for if-let font lockJonas Westlund
2017-08-14Fix recognition of "<" as operator in some contextTom Tromey
rust-mode identifies the "<<" as open angle brackets in let x = a[i][(1 << i)]; This patch fixes the problem by changing rust-is-in-expression-context to treat "]" as starting an expression in brace context. Fixes #212
2017-08-10Use `font-lock-variable-name-face' for `let' bindings.Aankhen
2017-08-05Merge pull request #220 from Aankhen/highlight-string-interpolationTom Tromey
Highlight interpolation in arguments to print! &c.
2017-08-02Make rust-beginning-of-defun ignore comments and stringsTom Tromey
Change rust-beginning-of-defun to keep searching when it stops in a comment or a string. Fixes #222.
2017-08-02Highlight interpolation in arguments to print! &c.Aankhen
2017-07-30Add syntax highlighting and imenu support for `union`Wilfred Hughes
`union` is a contextual keyword, so highlight it in the correct context. Otherwise, treat `union` similarly to `struct`.
2017-07-28Highlight question mark operator using new `rust-question-mark-face'.Aankhen
2017-07-13Define `rust-test-project-located' conditionally instead of using `skip-unless'.Aankhen
2017-07-13Skip `rust-test-project-located' without cargo and avoid `find-file' in test.Aankhen
2017-07-13Add `rust-run-clippy' and `rust-buffer-project' with testing paraphernalia.Aankhen
2017-05-06Add support for "default" keywordTom Tromey
Add context-sensitive fontification for the "default" keyword.
2017-04-11fix rust indentation bugTom Tromey
This patch fixes a bug I found where rust-mode would misindent code like: fn each_split_within<'a, F>(ss: &'a str, lim: usize, mut it: F) -> bool where F: FnMut(&'a str) -> bool { } fn test_split_within() { } In particular the second "fn" would be indented a level. On the "fn" line, rust-mode-indent-line was calling rust-beginning-of-defun, which would go to the previous defun. Fixing this required moving the definition of rust-top-item-beg-re higher in the file, before its first use (recent versions of Emacs insist on this). And, this required removing the "^" from this regexp, which is ok because the sole use is already adding a "^". Additionally, I moved the "\\_>" into the regexp, rather than have it added at the point of use, so that the new use would also benefit. This patch includes two new test cases.
2017-04-11Merge pull request #201 from tromey/question-indentationNiko Matsakis
fix syntax of "<" appearing after "?"
2017-04-11Merge pull request #197 from tromey/syntax-propertizeNiko Matsakis
Syntax propertize
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-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