diff options
| author | Tom Tromey <tom@tromey.com> | 2017-08-01 07:37:31 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-01 07:37:31 -0600 |
| commit | 30a9d398fbdb88af16725248656956cb350c821d (patch) | |
| tree | 87169c668cc8b1d88f7299052cefea15093cd528 /rust-mode-tests.el | |
| parent | 09efc45dee786cb220c233426ddd82b26ad950eb (diff) | |
| parent | 2a9fcd033b18bec27bbdeecc1397f2ddf4092bb1 (diff) | |
| download | rust-mode-30a9d398fbdb88af16725248656956cb350c821d.tar.gz | |
Merge pull request #221 from Wilfred/highlight_union_contextual_keyword
Add syntax highlighting and imenu support for `union`
Diffstat (limited to 'rust-mode-tests.el')
| -rw-r--r-- | rust-mode-tests.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el index 614340c..7f1020f 100644 --- a/rust-mode-tests.el +++ b/rust-mode-tests.el @@ -1551,6 +1551,19 @@ this_is_not_a_string();)" "fn" font-lock-keyword-face "f" font-lock-function-name-face))) +(ert-deftest rust-test-union-context-sensitive () + (rust-test-font-lock + "let union = 7; union foo { x: &'union bar }" + '("let" font-lock-keyword-face + ;; Ignore the first union, it's an unhighlighted variable. + ;; The second union is a contextual keyword. + "union" font-lock-keyword-face + "foo" font-lock-type-face + "x" font-lock-variable-name-face + ;; This union is the name of a lifetime. + "union" font-lock-variable-name-face + "bar" font-lock-type-face))) + (ert-deftest indent-method-chains-no-align () (let ((rust-indent-method-chain nil)) (test-indent " |
