[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 656590a 463/495: Fontify qualified composite liter
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 656590a 463/495: Fontify qualified composite literal types. |
Date: |
Sat, 7 Aug 2021 09:06:09 -0400 (EDT) |
branch: elpa/go-mode
commit 656590a695b2fcb1a0c398ce7c3317984edbb0c8
Author: Muir Manders <muir@mnd.rs>
Commit: Peter Sanford <psanford@sanford.io>
Fontify qualified composite literal types.
In "foo.Bar{}" we now fontify all of "foo.Bar" instead of just "Bar". This
is
consistent with how we fontify types in other places.
---
go-mode.el | 5 ++---
test/go-font-lock-test.el | 5 +++++
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/go-mode.el b/go-mode.el
index a58c091..6b55003 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -447,13 +447,12 @@ For mode=set, all covered lines will have this weight."
(,(concat "\\_<type\\_>[[:space:]]+\\([^[:space:](]+\\)") 1
font-lock-type-face) ;; types
(,(concat "\\_<type\\_>[[:space:]]+" go-identifier-regexp "[[:space:]]*"
go-type-name-regexp) 1 font-lock-type-face) ;; types
(,(concat "[^[:word:][:multibyte:]]\\[\\([[:digit:]]+\\|\\.\\.\\.\\)?\\]"
go-type-name-regexp) 2 font-lock-type-face) ;; Arrays/slices
- (,(concat "\\(" go-identifier-regexp "\\)" "{") 1 font-lock-type-face)
+ (,(concat go-type-name-regexp "{") 1 font-lock-type-face)
(,(concat "\\_<map\\_>\\[[^]]+\\]" go-type-name-regexp) 1
font-lock-type-face) ;; map value type
(,(concat "\\_<map\\_>\\[" go-type-name-regexp) 1 font-lock-type-face) ;;
map key type
(,(concat "\\_<chan\\_>[[:space:]]*\\(?:<-[[:space:]]*\\)?"
go-type-name-regexp) 1 font-lock-type-face) ;; channel type
(,(concat "\\_<\\(?:new\\|make\\)\\_>\\(?:[[:space:]]\\|)\\)*("
go-type-name-regexp) 1 font-lock-type-face) ;; new/make type
- ;; TODO do we actually need this one or isn't it just a function call?
- (,(concat "\\.\\s *(" go-type-name-regexp) 1 font-lock-type-face) ;; Type
conversion
+ (,(concat "\\.\\s *(" go-type-name-regexp) 1 font-lock-type-face) ;; Type
assertion
;; Like the original go-mode this also marks compound literal
;; fields. There, it was marked as to fix, but I grew quite
;; accustomed to it, so it'll stay for now.
diff --git a/test/go-font-lock-test.el b/test/go-font-lock-test.el
index ecbba92..d5f94fe 100644
--- a/test/go-font-lock-test.el
+++ b/test/go-font-lock-test.el
@@ -78,6 +78,11 @@ KswitchK 123 {
KcaseK string:
}"))
+(ert-deftest go--fontify-composite-literal ()
+ (should-fontify "TfooT{")
+ (should-fontify "[]TfooT{")
+ (should-fontify "Tfoo.ZarT{")
+ (should-fontify "[]Tfoo.ZarT{"))
(defun should-fontify (contents)
"Verify fontification.
- [nongnu] elpa/go-mode fbf2544 444/495: Improve fill-paragraph for comment blocks., (continued)
- [nongnu] elpa/go-mode fbf2544 444/495: Improve fill-paragraph for comment blocks., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e7e0157 447/495: indent: fix indent at top level of file, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3bc7479 450/495: Fix infinite loop in fill-region, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 88ffc9e 452/495: Add github action yaml file to run ert tests, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4f15abf 449/495: Fix fill-paragraph for certain block comments., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode a13b814 448/495: Add option to reuse a single buffer for godoc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode a82369b 453/495: Readme: add basic information about gopls., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 839190b 455/495: Run all tests in GH CI, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7248358 462/495: Fontify type names in type switch statements, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4fabba6 464/495: Small fix for fontification of array types, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 656590a 463/495: Fontify qualified composite literal types.,
ELPA Syncer <=
- [nongnu] elpa/go-mode d304565 474/495: Fix signature fontification after comments., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e9b9c0e 473/495: Add some fontification faces for go-dot-mod-mode., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4acf733 468/495: Fully fontify type and const decls., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode dac200f 469/495: Fix font locking in nested signatures., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode fa2162b 475/495: Fix "nil" fontification in type switch clause., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7ce031c 481/495: Allow disabling variable font locking., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e10d677 478/495: indent: fix func literals in dangling lines, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode c9f5e92 483/495: Fix indentation of chained dangling selectors., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode fdf46fe 492/495: Fix go.mod fontification., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e8eea7f 487/495: Fix fontification of multiline type switch clauses., ELPA Syncer, 2021/08/07