| Age | Commit message (Collapse) | Author |
|
Fixes #465.
When `rust-syntax-propertize` uses `rust-macro-scopes` to find
ranges of text that are macro arguments, it ends up inadvertently
poisoning the `syntax-ppss` cache by applying it to text that doesn't
have the necessary `syntax-table` properties applied yet - the very
job that `rust-syntax-propertize` is trying to do.
However, `rust-macro-scopes` does much more work than necessary.
Rather than producing a list of ranges of macro arguments, we can just
use the list of enclosing opening parens provided by syntax-ppss,
checking each paren to see if it seems to be a macro or `macro_rules`
call.
We have to keep syntax-ppss's cache accurate for other reasons anyway,
so we might as well just use its data, rather than introducing another
cache of our own - especially a problematic one (see #465).
* rust-mode.el (rust-in-macro): Consult `syntax-ppss`'s list of enclosing
parens, rather than using `rust-macro-scope`. Remove optional arguments, which
were only used by tests.
(rust-macro-scopes, rust-macro-scope): Delete. Now we just use `syntax-ppss`'s
internal cache.
(rust-syntax-propertize): Don't bind `rust-macro-scopes`.
(rust-looking-back-macro-rules): New function.
(rust-looking-back-macro): Support a space between macro name and `!`, by
consulting `rust-expression-introducers`.
(rust-expression-introducers): New constant. Use in `rust-looking-back-macro`
and `rust-is-in-expression-context`.
(rust-is-in-expression-context): Use `rust-expression-introducers`.
(rust-looking-back-ident): Don't use `looking-back`. We've already moved to the
correct spot for `looking-at`, within a `save-excursion`.
* rust-mode-tests.el: Update tests.
|
|
Obsolete since Emacs 29 / b7e867b841f47dcff3aeaef9b5608a237386ce70.
|
|
The byte compiler isn’t smart enough to figure out that these functions are
indeed defined in this code branch.
|
|
|
|
|
|
|
|
|
|
close #283
|
|
Calling ‘looking-back’ with only one argument causes a compile warning.
|
|
|
|
|
|
|
|
Enable the use of prettify-symbols-mode
|
|
Customizing this face may improve code readability for some users.
By default nothing is set for backward compatibility.
|
|
|
|
|
|
nil is a valid value for electric-pair-skip-self, so handle that case
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For the time being `require' the new library from "rust-mode.el".
In the mid-term we should stop doing that, so that users can load
it if and only if they want to do so.
|
|
|
|
|
|
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.
|
|
|
|
Because check exists and is so much faster, I only ever want to build
when I want to test the binary, in which case I'd use run. So I think
it's more useful to have a rust-check function available than it is to
even have rust-compile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
* Rename rust-mode-font-lock-keywords to rust-font-lock-keywords.
* Rename rust-mode-keywords to rust-keywords.
* Properly define rust-buffer-project.
|
|
|
|
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
|