mirror of
https://github.com/godotengine/emacs-gdscript-mode.git
synced 2025-12-31 21:48:34 +03:00
Add syntax highlighting for function calls
Closes #30. Pattern: identifier optional_spaces open_parenthesis The implementation uses `"("` instead `(syntax open-parenthesis)` as `open-parenthesis` is defined from `(open-paren (or "{" "[" "("))`. As a result, the regular expression would also highlight array and dictionary variables. The regular expression does highlight signal definitions with parameters, though, as they follow the same pattern of function calls. This could be avoided by ignoring expressions started with "signal" (or by adding a custom rule to highlight signal definitions).
This commit is contained in:
@@ -10,6 +10,7 @@ _Currently in development._
|
||||
|
||||
- Added a command to insert a path to a project file, either using `project-find-file` if `projectile` is available, otherwise with `find-file`.
|
||||
- Added a command to format a selected region with `gdformat`.
|
||||
- Added syntax highlighting for function calls.
|
||||
|
||||
### Bug fixes
|
||||
|
||||
|
||||
@@ -75,7 +75,12 @@
|
||||
(or "var" "const")
|
||||
(1+ space)
|
||||
(group (1+ (or word ?_))))
|
||||
(1 font-lock-variable-name-face))))
|
||||
(1 font-lock-variable-name-face))
|
||||
;; Function call
|
||||
(,(rx (group (1+ (or word ?_)))
|
||||
(0+ space)
|
||||
"(")
|
||||
(1 font-lock-function-name-face))))
|
||||
|
||||
(defvar gdscript-syntax-table (make-syntax-table))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user