File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 34
34
(require 'cl-lib ))
35
35
(require 'treesit )
36
36
(require 'c-ts-common )
37
+ (require 'php nil t )
37
38
39
+ (declare-function php-base-mode " ext:php" )
38
40
(declare-function treesit-parser-create " treesit.c" )
39
41
(declare-function treesit-induce-sparse-tree " treesit.c" )
40
42
(declare-function treesit-node-child " treesit.c" )
@@ -242,8 +244,17 @@ Return nil if there is no name or if NODE is not a defun node."
242
244
(treesit-node-child-by-field-name node " name" )
243
245
t ))))
244
246
247
+ (unless (eval-when-compile (fboundp 'php-base-mode ))
248
+ (define-derived-mode php-base-mode prog-mode " PHP base"
249
+ " Generic major mode for editing PHP script.
250
+
251
+ This mode is intended to be inherited by concrete major modes.
252
+ Currently there are `php-mode' and `php-ts-mode' ."
253
+ :group 'php
254
+ nil ))
255
+
245
256
;;;### autoload
246
- (define-derived-mode php-ts-mode prog -mode " PHP"
257
+ (define-derived-mode php-ts-mode php-base -mode " PHP"
247
258
" Major mode for editing PHP files, powered by tree-sitter."
248
259
:group 'php
249
260
:syntax-table php-ts-mode--syntax-table
You can’t perform that action at this time.
0 commit comments