File tree Expand file tree Collapse file tree 2 files changed +19
-11
lines changed Expand file tree Collapse file tree 2 files changed +19
-11
lines changed Original file line number Diff line number Diff line change 6
6
7
7
[ ![ CI] ( https://github.com/jcs-elpa/sideline-flycheck/actions/workflows/test.yml/badge.svg )] ( https://github.com/jcs-elpa/sideline-flycheck/actions/workflows/test.yml )
8
8
9
- N/A
9
+ * P.S. The implementation is extracted and modified from [ lsp-ui-sideline] ( https://github.com/emacs-lsp/lsp-ui#lsp-ui-sideline )
10
+ 's code action* .
10
11
11
12
## 🔨 Quickstart
12
13
13
14
``` elisp
14
- (setq sideline-backends-right '(sideline-lsp))
15
+ (leaf sideline
16
+ :init
17
+ (setq sideline-backends-right '(sideline-lsp)))
18
+
19
+ (leaf lsp-mode :hook (lsp-mode-hook . sideline-mode)) ; enable it when lsp is on
15
20
```
16
21
22
+ ## 🔧 Customization
23
+
24
+ * ` sideline-lsp-update-mode ` - When set to 'line' the information will be updated
25
+ when user changes current line otherwise the information will be updated when
26
+ user changes current point
27
+ * ` sideline-lsp-ignore-duplicate ` - Ignore duplicate code actions
28
+ * ` sideline-lsp-code-action ` - Face used to highlight code action text.
29
+ * ` sideline-lsp-code-actions-prefix ` - Prefix to insert before the code action title.
30
+
17
31
## Contribute
18
32
19
33
[ ![ PRs Welcome] ( https://img.shields.io/badge/PRs-welcome-brightgreen.svg )] ( http://makeapullrequest.com )
Original file line number Diff line number Diff line change @@ -70,12 +70,7 @@ otherwise the actions will be updated when user changes current point."
70
70
" Face used to highlight code action text."
71
71
:group 'sideline-lsp )
72
72
73
- (defcustom sideline-lsp-actions-symbol " 💡"
74
- " Code action icon."
75
- :type 'string
76
- :group 'sideline-lsp )
77
-
78
- (defcustom sideline-lsp-code-actions-prefix " "
73
+ (defcustom sideline-lsp-code-actions-prefix " 💡 "
79
74
" Prefix to insert before the code action title.
80
75
This can be used to insert, for example, an unicode character: 💡"
81
76
:type 'string
@@ -147,13 +142,12 @@ Execute CALLBACK to display candidates in sideline."
147
142
((title (->> (lsp:code-action-title action)
148
143
(replace-regexp-in-string " [\n\t ]+" " " )
149
144
(replace-regexp-in-string " " " " )
150
- (concat (unless sideline-lsp-actions-symbol
151
- sideline-lsp-code-actions-prefix))))
145
+ (concat sideline-lsp-code-actions-prefix)))
152
146
(code-action (lambda () (save-excursion (lsp-execute-code-action action))))
153
147
(len (length title))
154
148
(title (progn
155
149
(add-face-text-property 0 len 'sideline-lsp-code-action nil title)
156
- ( concat sideline-lsp-actions-symbol " " title) )))
150
+ title)))
157
151
(when (or (not sideline-lsp-ignore-duplicate)
158
152
(not (member title (ht-keys sideline-lsp--ht-code-actions))))
159
153
(ht-set sideline-lsp--ht-code-actions title code-action))))
You can’t perform that action at this time.
0 commit comments