Skip to content

Commit d194711

Browse files
author
Bozhidar Batsov
committed
Font-lock properly fully-qualified static method invocations
E.g. clojure.lang.Var/cloneThreadBindingFrame
1 parent 99aed44 commit d194711

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

clojure-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ Called by `imenu--generic-function'."
512512
"\\([a-z0-9-]+\\)")
513513
(1 font-lock-type-face nil t))
514514
;; foo/ Foo/ @Foo/
515-
("\\<@?\\([a-zA-Z][a-z0-9_-]*\\)/" 1 font-lock-type-face)
515+
("\\(?:\\<\\|\\.\\)@?\\([a-zA-Z][a-z0-9_-]*\\)/" 1 font-lock-type-face)
516516
;; fooBar
517517
("\\(?:\\<\\|/\\)\\([a-z]+[A-Z]+[a-zA-Z0-9$]*\\>\\)" 1 'clojure-interop-method-face)
518518
;; Highlight grouping constructs in regular expressions

test/clojure-mode-test.el

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ POS."
117117
(clojure-test-with-temp-buffer "Class/methodName"
118118
(should (eq (clojure-test-face-at 6 6) nil))
119119
(should (eq (clojure-test-face-at 1 5) 'font-lock-type-face))
120-
(should (eq (clojure-test-face-at 7 16) 'clojure-interop-method-face))))
120+
(should (eq (clojure-test-face-at 7 16) 'clojure-interop-method-face)))
121+
(clojure-test-with-temp-buffer "clojure.lang.Var/someMethod"
122+
(should (eq (clojure-test-face-at 17 17) nil))
123+
(should (eq (clojure-test-face-at 1 16) 'font-lock-type-face))
124+
(should (eq (clojure-test-face-at 18 27) 'clojure-interop-method-face))))
121125

122126
(ert-deftest clojure-mode-syntax-table/interop-method ()
123127
:tags '(fontification syntax-table)

0 commit comments

Comments
 (0)