[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/xr 14b639fc1e 10/18: Diagnostics now carry a range, no
From: |
ELPA Syncer |
Subject: |
[elpa] externals/xr 14b639fc1e 10/18: Diagnostics now carry a range, not a single string offset |
Date: |
Thu, 1 Aug 2024 13:00:01 -0400 (EDT) |
branch: externals/xr
commit 14b639fc1e7485cf8fc870f46a65e63ae0bf24f8
Author: Mattias EngdegÄrd <mattiase@acm.org>
Commit: Mattias EngdegÄrd <mattiase@acm.org>
Diagnostics now carry a range, not a single string offset
---
xr.el | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/xr.el b/xr.el
index 9bfdfc1e82..26d76a22cd 100644
--- a/xr.el
+++ b/xr.el
@@ -32,17 +32,25 @@
(require 'rx)
(require 'cl-lib)
-(defun xr--report (warnings position message)
- "Add the report MESSAGE at POSITION to WARNINGS."
+(defun xr--report-2 (warnings beg end message)
+ "Add the report MESSAGE at BEG..END to WARNINGS.
+BEG and END are inclusive char indices. END is nil if only start is known."
(when warnings
- (push (cons position message) (car warnings))))
+ (push (list beg end message) (car warnings))))
+
+(defun xr--report (warnings position message)
+ (xr--report-2 warnings position nil message))
(define-error 'xr-parse-error "xr parsing error")
-(defun xr--error (position message &rest args)
- "Format MESSAGE with ARGS at POSITION as an error and abort the parse."
+(defun xr--error-2 (beg end message &rest args)
+ "Format MESSAGE with ARGS at BEG..END as an error and abort the parse.
+END is nil if unknown."
(signal 'xr-parse-error
- (list (apply #'format-message message args) position)))
+ (list (apply #'format-message message args) beg end)))
+
+(defun xr--error (position message &rest args)
+ (apply #'xr--error-2 position nil message args))
;; House versions of `cl-some' and `cl-every', but faster.
@@ -1985,8 +1993,8 @@ If CHECKS is absent or nil, only perform checks that are
very
likely to indicate mistakes; if `all', include all checks,
including ones more likely to generate false alarms.
-Return a list of (OFFSET . COMMENT) where COMMENT applies at OFFSET
-in RE-STRING."
+Return a list of (BEG END COMMENT) where COMMENT applies at offsets
+BEG..END inclusive in RE-STRING."
(unless (memq purpose '(nil file))
(error "Bad xr-lint PURPOSE argument: %S" purpose))
(unless (memq checks '(nil all))
@@ -2003,8 +2011,8 @@ This includes uses of tolerated but discouraged
constructs.
Outright syntax violations are signalled as errors.
The argument is interpreted according to the syntax of
`skip-chars-forward' and `skip-chars-backward'.
-Return a list of (OFFSET . COMMENT) where COMMENT applies at OFFSET
-in SKIP-SET-STRING."
+Return a list of (BEG END COMMENT) where COMMENT applies at offsets
+BEG..END inclusive in SKIP-SET-STRING."
(let ((warnings (list nil)))
(xr--error-to-warnings
warnings (xr--parse-skip-set skip-set-string warnings))
- [elpa] externals/xr a3d8350cf7 09/18: Include parse errors in the diagnostics when linting, (continued)
- [elpa] externals/xr a3d8350cf7 09/18: Include parse errors in the diagnostics when linting, ELPA Syncer, 2024/08/01
- [elpa] externals/xr b07de9bc2c 05/18: Faster joining of chars to strings, ELPA Syncer, 2024/08/01
- [elpa] externals/xr 90cd77a251 11/18: Use ranges in warnings, ELPA Syncer, 2024/08/01
- [elpa] externals/xr f81b5de888 12/18: Extract diagnostics sorting to a function, ELPA Syncer, 2024/08/01
- [elpa] externals/xr 345b626abf 17/18: NEWS entry for upcoming version 2.0, ELPA Syncer, 2024/08/01
- [elpa] externals/xr ab11e4229d 03/18: Move version history to separate NEWS file, ELPA Syncer, 2024/08/01
- [elpa] externals/xr cbb39a2f52 06/18: Performance hack: speed up xr--superset-p for strings, ELPA Syncer, 2024/08/01
- [elpa] externals/xr 548990e952 04/18: Simplify: make second arg to xr--escape-string optional, ELPA Syncer, 2024/08/01
- [elpa] externals/xr ee9870ea83 08/18: Signal new `xr-parse-error` for parsing errors, ELPA Syncer, 2024/08/01
- [elpa] externals/xr a003438b44 01/18: Check xr-lint `purpose` argument for validity., ELPA Syncer, 2024/08/01
- [elpa] externals/xr 14b639fc1e 10/18: Diagnostics now carry a range, not a single string offset,
ELPA Syncer <=
- [elpa] externals/xr 6a708ef75a 14/18: Group diagnostics that belong together, ELPA Syncer, 2024/08/01
- [elpa] externals/xr e2455fd4bd 15/18: Add info-level messages for many warnings, ELPA Syncer, 2024/08/01
- [elpa] externals/xr 51c053d443 16/18: Require Emacs 27 or newer, ELPA Syncer, 2024/08/01
- [elpa] externals/xr 817916a07b 13/18: Add severity field (warning or error) to diagnostics, ELPA Syncer, 2024/08/01
- [elpa] externals/xr c5da86864b 18/18: Github CI: ignore changes to NEWS in actions, ELPA Syncer, 2024/08/01