[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/dart-mode ae8a28b 161/192: Follow conventions in font-lock
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/dart-mode ae8a28b 161/192: Follow conventions in font-lock levels |
Date: |
Sun, 29 Aug 2021 11:02:10 -0400 (EDT) |
branch: elpa/dart-mode
commit ae8a28b55937a9baa7ab1c964ef52cfbee97d35d
Author: Brady Trainor <mail@bradyt.com>
Commit: Brady Trainor <mail@bradyt.com>
Follow conventions in font-lock levels
For example, file directives are fontified at level one, and variables
are fontified at level three.
---
dart-mode.el | 35 +++++++++++++++++++++--------------
1 file changed, 21 insertions(+), 14 deletions(-)
diff --git a/dart-mode.el b/dart-mode.el
index ddda8c6..856c488 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -389,12 +389,16 @@ indentation levels from right to left."
;;; Additional fontification support
+(setq dart--file-directives
+ '("as" "deferred" "export" "hide" "import" "library" "of" "part"
+ "show"))
+
(setq dart--builtins
;; ECMA 408; Section: Identifier Reference
;; "Built-in identifiers"
'("abstract" "as" "deferred" "dynamic" "export" "external"
- "factory" "get" "implements" "import" "library" "operator"
- "part" "set" "static" "typedef"))
+ "hide" "factory" "get" "implements" "import" "library" "of"
+ "operator" "part" "set" "show" "static" "typedef"))
(setq dart--keywords
;; ECMA 408; Section: Reserved Words
@@ -598,7 +602,8 @@ indentation levels from right to left."
dart-font-lock-keywords-3)))
(setq dart-font-lock-keywords-1
- '((dart--function-declaration-func .
font-lock-function-name-face)))
+ `((,(regexp-opt dart--file-directives 'words) . font-lock-builtin-face)
+ (dart--function-declaration-func .
font-lock-function-name-face)))
(setq dart-font-lock-keywords-2
`(,dart--async-keywords-re
@@ -610,17 +615,19 @@ indentation levels from right to left."
(,dart--metadata-re . font-lock-constant-face)
(,(regexp-opt dart--types 'words) . font-lock-type-face)
(,dart--types-re . font-lock-type-face)
- (dart--function-declaration-func . font-lock-function-name-face)
- (dart--declared-identifier-func . font-lock-variable-name-face)
- (dart--declared-identifier-anchor-func
- . (dart--declared-identifier-next-func
- nil
- nil
- (0 font-lock-variable-name-face)))
- (dart--string-interpolation-id-func (0 font-lock-variable-name-face
t))
- (dart--string-interpolation-exp-func (0 font-lock-variable-name-face
t))))
-
-(setq dart-font-lock-keywords-3 dart-font-lock-keywords-2)
+ (dart--function-declaration-func . font-lock-function-name-face)))
+
+(setq dart-font-lock-keywords-3
+ (append
+ dart-font-lock-keywords-2
+ `((dart--declared-identifier-func . font-lock-variable-name-face)
+ (dart--declared-identifier-anchor-func
+ . (dart--declared-identifier-next-func
+ nil
+ nil
+ (0 font-lock-variable-name-face)))
+ (dart--string-interpolation-id-func (0 font-lock-variable-name-face
t))
+ (dart--string-interpolation-exp-func (0 font-lock-variable-name-face
t)))))
(setq dart-string-delimiter (rx (and
;; Match even number of backslashes.
- [nongnu] elpa/dart-mode 47dc5a0 146/192: Fixes flycheck in Windows, (continued)
- [nongnu] elpa/dart-mode 47dc5a0 146/192: Fixes flycheck in Windows, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 6e1c42f 156/192: Fontify string interpolation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode d78c5c7 142/192: Bump version to 1.0.4, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 1031016 141/192: Edit README to melpa rather than marmalade, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode d3d3d7e 188/192: Add indentation tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode e94acb5 168/192: Fontify SCREAMING_CAPS words of length greater than two as constant, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode c51e750 163/192: Stop testing 24.3 on travis, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 735868e 154/192: Copy/paste multiline string syntax-propertize from python.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 9ad52e8 158/192: Search for sdk from flutter if no dart on path, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode c568118 175/192: Move dart server code to a separate repo, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode ae8a28b 161/192: Follow conventions in font-lock levels,
ELPA Syncer <=
- [nongnu] elpa/dart-mode 327b9aa 167/192: Use conventions in commentary, docstrings, defvar vs setq, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 31861e8 173/192: Add mixin keyword, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 28ebbaf 176/192: Update tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode ea60ffd 178/192: Move README back to markdown, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode bbeadaa 181/192: Reorganize some keyword fontification, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode d6afa8c 153/192: Fontify identifiers following declared identifiers, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 9b65aae 187/192: Add failing tests for fontification of factories and generic methods, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode a715dc6 177/192: Move license, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode e820b09 155/192: Regex catches dollar signs now, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode e5bd30d 184/192: Avoid false positives, ELPA Syncer, 2021/08/29