Skip to content

Commit

Permalink
added font-lock to defoverridable
Browse files Browse the repository at this point in the history
  • Loading branch information
gausby committed Oct 15, 2015
1 parent 6ddde66 commit 6fa370b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion elixir-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
(or "def" "defp" "defmodule" "defprotocol"
"defmacro" "defmacrop" "defdelegate"
"defexception" "defstruct" "defimpl"
"defcallback")
"defcallback" "defoverridable")
symbol-end))
(builtin-namespace . ,(rx (or line-start (not (any ".")))
symbol-start
Expand Down
1 change: 1 addition & 0 deletions elixir-smie.el
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
("defp" non-block-expr "do" statements "end")
("defmacro" non-block-expr "do" statements "end")
("defmacrop" non-block-expr "do" statements "end")
("defoverridable" non-block-expr)
(non-block-expr "fn" match-statements "end")
(non-block-expr "do" statements "end")
("if" non-block-expr "do" statements "else" statements "end")
Expand Down
13 changes: 13 additions & 0 deletions test/elixir-mode-font-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,19 @@ end"
(should (eq (elixir-test-face-at 5) 'font-lock-function-name-face))
(should (eq (elixir-test-face-at 8) 'font-lock-function-name-face))))

(ert-deftest elixir-mode-syntax-table/fontify-defoverridable/1 ()
:tags '(fontification syntax-table)
(elixir-test-with-temp-buffer
"defmodule Foo do
defmacro __using__(_opts) do
quote do
def bar, do: :ok
defoverridable [bar: 0]
end
end
end"
(should (eq (elixir-test-face-at 91) 'font-lock-keyword-face))))

(ert-deftest elixir-mode-syntax-table/fontify-heredoc/1 ()
:tags '(fontification heredoc syntax-table)
(elixir-test-with-temp-buffer
Expand Down

0 comments on commit 6fa370b

Please sign in to comment.