Skip to content

Commit

Permalink
defgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Mar 3, 2018
1 parent a686060 commit ad3a6e0
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 38 deletions.
17 changes: 16 additions & 1 deletion cquery-codelens.el → cquery-code-lens.el
Expand Up @@ -24,6 +24,21 @@

(require 'cquery-common)

(defgroup cquery-code-lens nil
"cquery code lens."
:group 'tools
:group 'cquery)

(defface cquery-code-lens-face
'((t :inherit shadow))
"The face used for code lens overlays."
:group 'cquery-code-lens)

(defface cquery-code-lens-mouse-face
'((t :box t))
"The face used for code lens overlays."
:group 'cquery-code-lens)

;; ---------------------------------------------------------------------
;; Codelens
;;
Expand Down Expand Up @@ -104,4 +119,4 @@
(remove-hook 'lsp-after-diagnostics-hook 'cquery-code-lens--request-when-idle t)
(cquery-clear-code-lens))))

(provide 'cquery-codelens)
(provide 'cquery-code-lens)
55 changes: 25 additions & 30 deletions cquery-semantic-highlighting.el
Expand Up @@ -28,129 +28,124 @@
;; Customization
;; ---------------------------------------------------------------------

(defgroup cquery-sem nil
"cquery semantic highlighting."
:group 'tools
:group 'cquery)

(defface cquery-inactive-region-face
'((t :inherit shadow))
"The face used to mark inactive regions."
:group 'cquery)
:group 'cquery-sem)

(defvar cquery-sem-face-function 'cquery-sem--default-face
"Function used to determine the face of a symbol in semantic highlighting.")

(defface cquery-sem-member-face
'((t :slant italic))
"The extra face applied to member functions/variables."
:group 'cquery)
:group 'cquery-sem)

(defface cquery-sem-static-face
'((t :weight bold))
"The additional face for variables with static storage."
:group 'cquery)
:group 'cquery-sem)

(defface cquery-sem-static-field-face
'((t :inherit cquery-sem-static-face))
"The additional face for static member variables."
:group 'cquery)
:group 'cquery-sem)

(defface cquery-sem-static-method-face
'((t :inherit cquery-sem-static-face))
"The additional face for static member functions."
:group 'cquery)
:group 'cquery-sem)

(defcustom cquery-sem-function-faces [font-lock-function-name-face]
"Faces for functions."
:type '(repeat face)
:group 'cquery)
:group 'cquery-sem)

(defcustom cquery-sem-macro-faces [font-lock-variable-name-face]
"Faces for macros."
:type '(repeat face)
:group 'cquery)
:group 'cquery-sem)

(defcustom cquery-sem-namespace-faces [font-lock-constant-face]
"Faces for namespaces."
:type '(repeat face)
:group 'cquery)
:group 'cquery-sem)

(defcustom cquery-sem-parameter-faces [font-lock-variable-name-face]
"Faces for parameters."
:type '(repeat face)
:group 'cquery)
:group 'cquery-sem)

(defcustom cquery-sem-type-faces [font-lock-type-face]
"Faces used to mark types."
:type '(repeat face)
:group 'cquery)
:group 'cquery-sem)

(defcustom cquery-sem-variable-faces [font-lock-variable-name-face]
"Faces for variables."
:type '(repeat face)
:group 'cquery)
:group 'cquery-sem)

;; Default colors used by `cquery-use-default-rainbow-sem-highlight'
(defcustom cquery-sem-function-colors
'("#e5b124" "#927754" "#eb992c" "#e2bf8f" "#d67c17"
"#88651e" "#e4b953" "#a36526" "#b28927" "#d69855")
"Default colors for `cquery-sem-function-faces'."
:type '(repeat color)
:group 'cquery)
:group 'cquery-sem)

(defcustom cquery-sem-macro-colors
'("#e79528" "#c5373d" "#e8a272" "#d84f2b" "#a67245"
"#e27a33" "#9b4a31" "#b66a1e" "#e27a71" "#cf6d49")
"Default colors for `cquery-sem-macro-faces'."
:type '(repeat color)
:group 'cquery)
:group 'cquery-sem)

(defcustom cquery-sem-namespace-colors
'("#429921" "#58c1a4" "#5ec648" "#36815b" "#83c65d"
"#417b2f" "#43cc71" "#7eb769" "#58bf89" "#3e9f4a")
"Default colors for `cquery-sem-namespace-faces'."
:type '(repeat color)
:group 'cquery)
:group 'cquery-sem)

(defcustom cquery-sem-parameter-colors
'("#429921" "#58c1a4" "#5ec648" "#36815b" "#83c65d"
"#417b2f" "#43cc71" "#7eb769" "#58bf89" "#3e9f4a")
"Default colors for `cquery-sem-parameter-faces'."
:type '(repeat color)
:group 'cquery)
:group 'cquery-sem)

(defcustom cquery-sem-type-colors
'("#e1afc3" "#d533bb" "#9b677f" "#e350b6" "#a04360"
"#dd82bc" "#de3864" "#ad3f87" "#dd7a90" "#e0438a")
"Default colors for `cquery-sem-type-faces'."
:type '(repeat color)
:group 'cquery)
:group 'cquery-sem)

(defcustom cquery-sem-variable-colors
cquery-sem-parameter-colors
"Default colors for `cquery-sem-variable-faces'."
:type '(repeat color)
:group 'cquery)

(defface cquery-code-lens-face
'((t :inherit shadow))
"The face used for code lens overlays."
:group 'cquery)

(defface cquery-code-lens-mouse-face
'((t :box t))
"The face used for code lens overlays."
:group 'cquery)
:group 'cquery-sem)

(defcustom cquery-enable-inactive-region
t
"Enable inactive region.
Regions that are disabled by preprocessors will be displayed in shadow."
:group 'cquery
:group 'cquery-sem
:type 'bool)

(defcustom cquery-sem-highlight-method
nil
"The method used to draw semantic highlighting.
overlays are more accurate than font-lock, but slower.
If nil, disable semantic highlighting."
:group 'cquery
:group 'cquery-sem
:type '(radio
(const nil)
(const :tag "overlay" overlay)
Expand Down Expand Up @@ -268,7 +263,7 @@ If nil, disable semantic highlighting."
(append
(--map-indexed
`(defface ,(intern (format "cquery-sem-%s-face-%S" kind it-index))
'((t :foreground ,it)) "." :group 'cquery)
'((t :foreground ,it)) "." :group 'cquery-sem)
(symbol-value colors))
(list
`(setq ,(intern (format "cquery-sem-%s-faces" kind))
Expand Down
17 changes: 11 additions & 6 deletions cquery-tree.el
Expand Up @@ -28,34 +28,39 @@
;; Customization
;; ---------------------------------------------------------------------

(defgroup cquery-tree nil
"cquery tree."
:group 'tools
:group 'cquery)

(defcustom cquery-tree-initial-levels 2
"."
:group 'cquery)
:group 'cquery-tree)

(defface cquery-tree-root-face
'((t (:height 1.5 :line-height 2.0)))
"."
:group 'cquery)
:group 'cquery-tree)

(defface cquery-tree-mouse-face
'((t (:background "green")))
"."
:group 'cquery)
:group 'cquery-tree)

(defface cquery-tree-icon-face
'((t (:foreground "grey")))
"."
:group 'cquery)
:group 'cquery-tree)

(defface cquery-tree-header-line-face
'((t (:foreground "grey" :height 0.8)))
"."
:group 'cquery)
:group 'cquery-tree)

(defface cquery-tree-mode-line-face
'((t (:foreground "grey" :slant italic)))
"."
:group 'cquery)
:group 'cquery-tree)

;; ---------------------------------------------------------------------
;; Tree node
Expand Down
2 changes: 1 addition & 1 deletion cquery.el
Expand Up @@ -37,7 +37,7 @@

(require 'cquery-common)
(require 'cquery-semantic-highlighting)
(require 'cquery-codelens)
(require 'cquery-code-lens)
(require 'cquery-tree)
(require 'cquery-call-hierarchy)
(require 'cquery-inheritance-hierarchy)
Expand Down

0 comments on commit ad3a6e0

Please sign in to comment.