Skip to content

Commit 25b8493

Browse files
Demis Balbachzonuexe
authored andcommitted
Add import statement face
1 parent b73e7fc commit 25b8493

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

php-face.el

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,21 @@
206206
:group 'php-faces
207207
:tag "PHP Class Declaration")
208208

209+
(defface php-class-declaration-spec '((t (:inherit php-keyword)))
210+
"Face used to highlight class declaration specification keywords (implements, extends)"
211+
:group 'php-faces
212+
:tag "PHP Class Declaration Specification")
213+
214+
(defface php-namespace-declaration '((t (:inherit php-keyword)))
215+
"Face used to highlight namespace declaration keyword."
216+
:group 'php-faces
217+
:tag "PHP Namespace Declaration")
218+
219+
(defface php-import-declaration '((t (:inherit php-keyword)))
220+
"PHP Mode Face used to highlight import statements (use ... as ...)."
221+
:group 'php-faces
222+
:tag "PHP Import Statement")
223+
209224
(define-obsolete-face-alias 'php-annotations-annotation-face 'php-doc-annotation-tag "1.19.0")
210225

211226
(provide 'php-face)

php-mode.el

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,6 +1494,15 @@ a completion list."
14941494
;; only add patterns here if you want to prevent cc-mode from applying
14951495
;; a different face.
14961496
`(
1497+
;; Class declaration specification keywords (implements, extends)
1498+
("\\_<\\(?:implements\\|extends\\)\\_>" . 'php-class-declaration-spec)
1499+
;; Namespace declaration
1500+
("\\_<namespace\\_>" . 'php-namespace-declaration)
1501+
;; import statement
1502+
("\\_<use\\_>" . 'php-import-declaration)
1503+
;; Class modifiers (abstract, final)
1504+
("\\_<\\(abstract\\|final\\)\\_>\\s-+\\_<class\\>" 1 'php-class-modifier)
1505+
14971506
;; Highlight variables, e.g. 'var' in '$var' and '$obj->var', but
14981507
;; not in $obj->var()
14991508
("\\(->\\)\\(\\sw+\\)\\s-*(" (1 'php-object-op) (2 'php-method-call))

0 commit comments

Comments
 (0)