summaryrefslogtreecommitdiff
path: root/guix/diagnostics.scm
AgeCommit message (Collapse)Author
2022-05-31diagnostics: Fix typo about 0-indexed COL in location.Maxim Cournoyer
* guix/diagnostics.scm (source-properties->location): The location column is 0-indexed, not 1-indexed (the same as in source-properties, so the code is accurate).
2022-04-08diagnostics: Turn diagnostic locations into hyperlinks.Ludovic Courtès
* guix/diagnostics.scm (print-diagnostic-prefix): Use 'location->hyperlink' when 'supports-hyperlinks?' returns true.
2022-04-08ui: Move 'location->hyperlink' to (guix diagnostics).Ludovic Courtès
* guix/ui.scm (location->hyperlink): Move to... * guix/diagnostics.scm: ... here. * guix/scripts/system/search.scm: Adjust imports accordingly.
2021-11-17diagnostics: Add syntax to capture arguments' syntax-properties.Josselin Poiret
* guix/diagnostics.scm (define-with-syntax-properties): Add it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-04-29diagnostics, ui: Adjust to 'read-error' and 'syntax-error' in Guile 3.0.6.Ludovic Courtès
* guix/diagnostics.scm (source-properties->location): Add clause for vectors. * guix/ui.scm (report-load-error): Tweak 'read-error' handling for 3.0.6. * tests/guix-package.sh: Relax regexp for the "unbound variable" diagnostic check. * tests/guix-system.sh: Adjust "missing closing paren" check for 3.0.6. * tests/records.scm (location-alist): New procedure. ("define-record-type* & wrong field specifier") ("define-record-type* & wrong field specifier, identifier") ("define-record-type* & duplicate initializers"): Use it.
2020-07-25diagnostics: Add '&formatted-message'.Ludovic Courtès
This allows 'gettext' to be called on the format string at the site where the exception is caught (rather than the site where it's thrown). It also allows for argument highlighting. * guix/diagnostics.scm (&formatted-message): New condition type. (check-format-string): New procedure. (formatted-message): New macro. * guix/ui.scm (report-load-error): Add clause for 'formatted-message?'. (warn-about-load-error): Likewise. (call-with-error-handling): Likewise. (read/eval): Likewise.
2020-07-25diagnostics: Add a procedural variant of diagnostic procedures.Ludovic Courtès
Callers can pass 'report-error', 'warning', etc. to 'apply'. * guix/diagnostics.scm (trivial-format-string?): New procedure, moved from... (highlight-argument): ... here. (define-diagnostic): Add 'identifier?' clause. (emit-diagnostic): New procedure.
2020-07-25utils: Move '&fix-hint' to (guix diagnostics).Ludovic Courtès
* guix/utils.scm (&fix-hint): Move to... * guix/diagnostics.scm (&fix-hint): ... here. * gnu.scm: Adjust imports accordingly. * gnu/system/mapped-devices.scm: Likewise. * guix/channels.scm: Likewise. * guix/profiles.scm: Likewise. * guix/scripts/system/reconfigure.scm: Likewise. * guix/ssh.scm: Likewise.
2020-07-25utils: Move <location> and '&error-location' to (guix diagnostics).Ludovic Courtès
* guix/utils.scm (<location>, source-properties->location) (location->source-properties, &error-location): Move to... * guix/diagnostics.scm: ... here. * gnu.scm: Adjust imports accordingly. * gnu/machine.scm: Likewise. * gnu/system.scm: Likewise. * gnu/tests.scm: Likewise. * guix/inferior.scm: Likewise. * tests/channels.scm: Likewise. * tests/packages.scm: Likewise.
2019-08-28diagnostics: Avoid highlighting complete messages.Ludovic Courtès
* guix/diagnostics.scm (%highlight-argument): Don't highlight ARG if it contains white space.
2019-06-03Add (guix diagnostics).Ludovic Courtès
* guix/ui.scm (warning, info, report-error, leave) (location->string, guix-warning-port, program-name) (highlight-argument, %highlight-argument, define-diagnostic) (%warning-color, %info-color, %error-color) (print-diagnostic-prefix): Move to... * guix/diagnostics.scm: ... here. New file. * Makefile.am (MODULES): Add it.