Skip to content

Commit 6fa370b

Browse files
committed
added font-lock to defoverridable
1 parent 6ddde66 commit 6fa370b

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

elixir-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
(or "def" "defp" "defmodule" "defprotocol"
143143
"defmacro" "defmacrop" "defdelegate"
144144
"defexception" "defstruct" "defimpl"
145-
"defcallback")
145+
"defcallback" "defoverridable")
146146
symbol-end))
147147
(builtin-namespace . ,(rx (or line-start (not (any ".")))
148148
symbol-start

elixir-smie.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
("defp" non-block-expr "do" statements "end")
109109
("defmacro" non-block-expr "do" statements "end")
110110
("defmacrop" non-block-expr "do" statements "end")
111+
("defoverridable" non-block-expr)
111112
(non-block-expr "fn" match-statements "end")
112113
(non-block-expr "do" statements "end")
113114
("if" non-block-expr "do" statements "else" statements "end")

test/elixir-mode-font-test.el

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,19 @@ end"
139139
(should (eq (elixir-test-face-at 5) 'font-lock-function-name-face))
140140
(should (eq (elixir-test-face-at 8) 'font-lock-function-name-face))))
141141

142+
(ert-deftest elixir-mode-syntax-table/fontify-defoverridable/1 ()
143+
:tags '(fontification syntax-table)
144+
(elixir-test-with-temp-buffer
145+
"defmodule Foo do
146+
defmacro __using__(_opts) do
147+
quote do
148+
def bar, do: :ok
149+
defoverridable [bar: 0]
150+
end
151+
end
152+
end"
153+
(should (eq (elixir-test-face-at 91) 'font-lock-keyword-face))))
154+
142155
(ert-deftest elixir-mode-syntax-table/fontify-heredoc/1 ()
143156
:tags '(fontification heredoc syntax-table)
144157
(elixir-test-with-temp-buffer

0 commit comments

Comments
 (0)