1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-11 00:30:17 -08:00
emacs/test/lisp/progmodes/rust-ts-mode-resources/font-lock-no-parent.rs
Steven Allen f0b987c32c rust-ts-mode: handle invalid rust syntax without signaling
Don't signal an error when encountering invalid rust syntax.  Without
this patch, invalid rust code would prevent a chunk of the buffer from
being highlighted (bug#79272).

* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--fontify-scope):
(rust-ts-mode--fontify-pattern): Avoid calling `string-match-p' on nil
when a node is missing a parent.
* test/lisp/progmodes/rust-ts-mode-resources/font-lock-no-parent.rs:
Rust file that reproduces the issue.
* test/lisp/progmodes/rust-ts-mode-tests.el: Test case to reproduce the
issue.
2025-08-21 19:59:04 +03:00

7 lines
159 B
Rust

+// intentionally invalid syntax
+const THING: [u8; 48] = [];
// should recover here and highlight the text below
trait Foo() {
// ^ font-lock-keyword-face
}