Extract Clojure compilation error handling into cider-compilation.el#3912
Merged
Conversation
Move the ~500-line compilation-error handling subsystem out of
cider-eval.el into its own module. Sits below cider-eval.el in the
layering: turns nREPL eval-error / stacktrace responses into the
*cider-error* buffer, source overlays, and inline messages.
Moved:
- The user-tunable knobs: cider-show-error-buffer, cider-auto-jump-to-error,
cider-auto-select-error-buffer, cider-error-highlight-face,
cider-warning-highlight-face, cider-inline-error-message-function,
cider-clojure-compilation-error-phases (plus its default value).
- The compilation/error parsing and rendering subsystem:
cider-clojure-compilation-regexp, cider-module-info-regexp,
cider-compilation-regexp, cider-extract-error-info,
cider-handle-compilation-errors, cider--display-error-unobtrusively,
cider--handle-stacktrace-response, cider--analyze-last-stacktrace,
cider-default-err-{handler,op-handler,eval-handler,eval-print-handler},
cider--handle-err-eval-response, cider--clojure-1.10-{error,location},
cider--clojure-warning, cider--render-stacktrace-causes,
cider--find-last-error-location, cider--goto-expression-start,
cider--show-error-buffer-p, cider-new-error-buffer,
cider-emit-into-color-buffer, cider-jump-to-compilation-error,
cider-find-property.
- Highlight-clearing helpers from the old "Utilities" section
(cider--clear-compilation-highlights, cider-clear-compilation-highlights,
cider--quit-error-window).
- cider--shorten-error-message (only used as the default of
cider-inline-error-message-function).
cider-eval.el requires cider-compilation and drops compile from its
requires (no longer needed there). Two consumers that don't go through
cider-eval (cider-log.el and cider-test.el) add an explicit require for
cider-auto-select-error-buffer.
The new file forward-declares only `cider-repl-mode' (used in a
derived-mode-p check); no other shims needed.
cider-eval.el drops from 1650 to 1156 lines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull the ~500-line compilation-error handling subsystem out of cider-eval.el into its own module. cider-compilation sits below cider-eval in the layering: it turns nREPL eval-error / stacktrace responses into the
*cider-error*buffer, source overlays, and inline messages.Moved:
cider-show-error-buffer,cider-auto-jump-to-error,cider-auto-select-error-buffer,cider-error-highlight-face,cider-warning-highlight-face,cider-inline-error-message-function,cider-clojure-compilation-error-phases(+ its default).cider-clojure-compilation-regexp,cider-module-info-regexp,cider-compilation-regexp,cider-extract-error-info,cider-handle-compilation-errors,cider--display-error-unobtrusively,cider--handle-stacktrace-response,cider--analyze-last-stacktrace, thecider-default-err-*-handlerfamily,cider--handle-err-eval-response,cider--clojure-{1.10-error,1.10-location,warning},cider--render-stacktrace-causes,cider--find-last-error-location,cider--goto-expression-start,cider--show-error-buffer-p,cider-new-error-buffer,cider-emit-into-color-buffer,cider-jump-to-compilation-error,cider-find-property.cider--clear-compilation-highlights,cider-clear-compilation-highlights,cider--quit-error-window).cider--shorten-error-message(only used as the default ofcider-inline-error-message-function).Coupling:
compilefrom its requires.cider-auto-select-error-buffer.cider-repl-mode(used in aderived-mode-pcheck); no other shims needed.cider-eval.el: 1650 → 1156 lines. cider-compilation.el: 562 lines (new).