diff options
author | Dmitry Gutov <dgutov@yandex.ru> | 2023-02-25 03:15:46 +0200 |
---|---|---|
committer | Dmitry Gutov <dgutov@yandex.ru> | 2023-02-25 03:35:08 +0200 |
commit | a795c51f6053272de61bc1721305e3c15ff424ee (patch) | |
tree | 4dcc2aea937392b95296c4b943059f1d5c454800 /lisp/font-lock.el | |
parent | 146bce49321da3b65d0a0e0326bb54cf1e79551c (diff) | |
download | emacs-a795c51f6053272de61bc1721305e3c15ff424ee.tar.gz emacs-a795c51f6053272de61bc1721305e3c15ff424ee.tar.bz2 emacs-a795c51f6053272de61bc1721305e3c15ff424ee.zip |
Add more/finer faces for tree-sitter
* doc/lispref/modes.texi (Faces for Font Lock):
Update the list of faces (bug#61655).
* etc/NEWS: Update the list of new faces.
* lisp/cus-theme.el (custom-theme--listed-faces): Update.
* lisp/font-lock.el (font-lock-function-call-face)
(font-lock-variable-ref-face, font-lock-property-ref-face):
New faces.
(font-lock-property-name-face):
Rename from 'font-lock-property-face'.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings):
Use new faces. More 'enumerator' query to 'definition' feature.
(c-ts-mode--fontify-declarator, c-ts-mode--fontify-variable):
Use new faces.
* lisp/progmodes/cmake-ts-mode.el
(cmake-ts-mode--font-lock-settings): Use new faces.
* lisp/progmodes/csharp-mode.el
(csharp-ts-mode--font-lock-settings): Use new faces.
* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Use new faces.
* lisp/progmodes/java-ts-mode.el
(java-ts-mode--font-lock-settings): Use new faces.
* lisp/progmodes/js.el (js--treesit-fontify-assignment-lhs)
(js--treesit-font-lock-settings): Use new faces. Highlight
variable definitions inside array and object destructuring
patterns.
* lisp/progmodes/python.el (python--treesit-variable-p):
Exclude identifiers in parameters.
(python--treesit-settings): Use new faces. Highlight function
parameters. Move 'keyword' up to still highlight 'self' as
keyword.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
Use new faces.
* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode--font-lock-settings): Use new faces.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Use new faces.
* lisp/textmodes/css-mode.el (css--treesit-settings):
Use font-lock-property-ref-face.
* lisp/textmodes/toml-ts-mode.el
(toml-ts-mode--font-lock-settings):
Use font-lock-property-ref-face.
* lisp/textmodes/yaml-ts-mode.el
(yaml-ts-mode--font-lock-settings): Same.
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r-- | lisp/font-lock.el | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 9e944fe188a..b82b7648797 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -2026,6 +2026,12 @@ as the constructs of Haddock, Javadoc and similar systems." "Font Lock mode face used to highlight function names." :group 'font-lock-faces) +(defface font-lock-function-call-face + '((t :inherit font-lock-function-name-face)) + "Font Lock mode face used to highlight function calls." + :group 'font-lock-faces + :version "29.1") + (defface font-lock-variable-name-face '((((class grayscale) (background light)) :foreground "Gray90" :weight bold :slant italic) @@ -2040,6 +2046,12 @@ as the constructs of Haddock, Javadoc and similar systems." "Font Lock mode face used to highlight variable names." :group 'font-lock-faces) +(defface font-lock-variable-ref-face + '((t :inherit font-lock-variable-name-face)) + "Font Lock mode face used to highlight variable references." + :group 'font-lock-faces + :version "29.1") + (defface font-lock-type-face '((((class grayscale) (background light)) :foreground "Gray90" :weight bold) (((class grayscale) (background dark)) :foreground "DimGray" :weight bold) @@ -2115,10 +2127,17 @@ as the constructs of Haddock, Javadoc and similar systems." :group 'font-lock-faces :version "29.1") -(defface font-lock-property-face +(defface font-lock-property-name-face '((t :inherit font-lock-variable-name-face)) "Font Lock mode face used to highlight properties of an object. -For example, the declaration and use of fields in a struct." +For example, the declaration of fields in a struct." + :group 'font-lock-faces + :version "29.1") + +(defface font-lock-property-ref-face + '((t :inherit font-lock-property-name-face)) + "Font Lock mode face used to highlight property references. +For example, property lookup of fields in a struct." :group 'font-lock-faces :version "29.1") |