Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

- `sideline-flycheck-display-mode` - Method type to when sideline will display flycheck's errors.
- `sideline-flycheck-show-checker-name` - If non-nil, show the checker's name at the back.
- `sideline-flycheck-show-error-id` - If non-nil, append the diagnostic ID (e.g. `reportUnusedExpression`, `E501`) to the error message`.
- `sideline-flycheck-max-lines` - Maximum number of lines to show.

## 🛠️ Contribute
Expand Down
13 changes: 12 additions & 1 deletion sideline-flycheck.el
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@
:type 'boolean
:group 'sideline-flycheck)

(defcustom sideline-flycheck-show-error-id nil
"If non-nil, append the diagnostic ID to the error message.

For LSP-backed diagnostics this surfaces codes such as
\"reportUnusedExpression\" or \"E501\" alongside the message,
formatted via `flycheck-error-format-message-and-id'."
:type 'boolean
:group 'sideline-flycheck)

(defcustom sideline-flycheck-max-lines 1
"Maximum number of lines to show."
:type 'integer
Expand Down Expand Up @@ -156,7 +165,9 @@ Argument COMMAND is required in sideline backend."
(`warning sideline-flycheck-warning-prefix)
(`error sideline-flycheck-error-prefix)
(`info sideline-flycheck-info-prefix)))
(msg (flycheck-error-message err))
(msg (if sideline-flycheck-show-error-id
(flycheck-error-format-message-and-id err)
(flycheck-error-message err)))
(lines (split-string msg "\n"))
(lines (butlast lines (- (length lines) sideline-flycheck-max-lines)))
(msg (mapconcat #'identity lines "\n"))
Expand Down
Loading