Skip to content

Commit a522f61

Browse files
committed
Be case sensitive on keywords
1 parent dc4a6ab commit a522f61

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

hack-mode.el

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,9 +1116,10 @@ interpolating inside the XHP expression."
11161116
"Search forward from point for an occurrence of a keyword."
11171117
;; Keywords in PHP are case insensitive. In Hack, it's a syntax
11181118
;; error if you use the wrong case, but they're still reserved (so
1119-
;; you can't call a function CLASS).
1120-
(let ((case-fold-search t))
1121-
(hack--search-forward-no-xhp hack--keyword-regex limit)))
1119+
;; you can't call a function CLASS). However, we have namespaces
1120+
;; that use keywords with a different case (e.g HH\Lib\Keyset), so
1121+
;; ignore occurrence with other cases.
1122+
(hack--search-forward-no-xhp hack--keyword-regex limit))
11221123

11231124
(defun hack--search-forward-type (limit)
11241125
"Search forward from point for an occurrence of a type name."

0 commit comments

Comments
 (0)