aboutsummaryrefslogtreecommitdiffstats
path: root/oni-php/oni-php.el
diff options
context:
space:
mode:
authorGravatar Tom Willemse2026-01-08 12:13:38 -0800
committerGravatar Tom Willemse2026-01-08 12:13:38 -0800
commit2376f20be34c5c94919ab73ced02b9b89c91f160 (patch)
tree074d8c5e338ed9eaa3b63a34407b96e2f894f7a1 /oni-php/oni-php.el
parentbc8b6a7c255ec7fa13f5a1e7533da0fa5f2e5b58 (diff)
downloademacs-config-2376f20be34c5c94919ab73ced02b9b89c91f160.tar.gz
emacs-config-2376f20be34c5c94919ab73ced02b9b89c91f160.zip
oni-php: Add conditions to expanding short snippets
Diffstat (limited to 'oni-php/oni-php.el')
-rw-r--r--oni-php/oni-php.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/oni-php/oni-php.el b/oni-php/oni-php.el
index e631d72..88af7af 100644
--- a/oni-php/oni-php.el
+++ b/oni-php/oni-php.el
@@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2025.1222.143742
+;; Version: 2026.0107.143829
;; Package-Requires: (php-mode oni-yasnippet oni-flycheck oni-company oni-hydra oni-smartparens ggtags fic-mode company-php rainbow-delimiters rainbow-identifiers)
;; This program is free software; you can redistribute it and/or modify
@@ -239,5 +239,14 @@ Otherwise call FUNC with ARGS. This is meant as advice around
"}" > "\n"
"}")))
+(defun oni-php-in-expression-context-p ()
+ (not (oni-php-in-static-call-context-p)))
+
+(defun oni-php-in-test-file ()
+ (string-suffix-p "Test.php" buffer-file-name))
+
+(defun oni-php-in-static-call-context-p ()
+ (looking-back "::\\w+" (- (point) (line-beginning-position))))
+
(provide 'oni-php)
;;; oni-php.el ends here