[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phpinspect 2e6b0e9d2f 15/30: Make handling of corrupt i
From: |
ELPA Syncer |
Subject: |
[elpa] externals/phpinspect 2e6b0e9d2f 15/30: Make handling of corrupt index more robust + convert regexp to constant |
Date: |
Sat, 31 Aug 2024 09:58:53 -0400 (EDT) |
branch: externals/phpinspect
commit 2e6b0e9d2f53247c38318cc178de08b387b95834
Author: Hugo Thunnissen <devel@hugot.nl>
Commit: Hugo Thunnissen <devel@hugot.nl>
Make handling of corrupt index more robust + convert regexp to constant
---
phpinspect-buffer.el | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/phpinspect-buffer.el b/phpinspect-buffer.el
index e7bb71091d..115cf687a7 100644
--- a/phpinspect-buffer.el
+++ b/phpinspect-buffer.el
@@ -178,7 +178,9 @@ linked with."
(phpinspect-buffer-project buffer)
(car func))))
(phpi-typedef-delete-method class (cdr func))))
- (t (error "Invalid index location")))))
+ (t (phpinspect-message "Invalid index location, reindexing
buffer")
+ (phpinspect-buffer-reindex buffer)
+ (error "invalid index location")))))
(t (error "Cannot delete index for token %s" token))))
(cl-defmethod phpinspect-buffer-namespace-at-point ((buffer phpinspect-buffer)
(point integer))
@@ -582,6 +584,10 @@ continuing execution."
(phpinspect-buffer-parse buffer)
(phpinspect-buffer-map buffer))
+(define-inline phpinspect--atom-regexp ()
+ "A regular expression that matches (sequences of) atomic tokens."
+ (inline-quote "\\(\\$\\|->\\|::\\)?[^][)(}{[:blank:]\n;'\"]+"))
+
(cl-defmethod phpinspect-buffer-register-edit
((buffer phpinspect-buffer) (start integer) (end integer) (pre-change-length
integer))
"Mark a region of the buffer as edited."
@@ -591,7 +597,7 @@ continuing execution."
;; they grow or shrink, so their full regions need to be marked for a
reparse).
(save-excursion
(goto-char start)
- (when (looking-back "\\(\\$\\|->\\|::\\)?[^][)(}{[:blank:]\n;'\"]+" nil t)
+ (when (looking-back (phpinspect--atom-regexp) nil t)
(setq start (- start (length (match-string 0))))
(setq pre-change-length (+ pre-change-length (length (match-string
0))))))
@@ -639,4 +645,12 @@ use."
(when phpinspect-current-buffer
(phpinspect-buffer-register-edit phpinspect-current-buffer start end
pre-change-length)))
+(define-inline phpinspect-with-current-buffer (buffer &rest body)
+ (declare (indent 1))
+ (inline-letevals (buffer)
+ (push 'progn body)
+ (inline-quote
+ (with-current-buffer (phpinspect-buffer-buffer ,buffer)
+ ,body))))
+
(provide 'phpinspect-buffer)
- [elpa] externals/phpinspect 96dd700be5 08/30: Replace phpinspect--class with new phpinspect-typedef structure, (continued)
- [elpa] externals/phpinspect 96dd700be5 08/30: Replace phpinspect--class with new phpinspect-typedef structure, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect a66e35f57c 09/30: Test and improve typedef index reactivity and lazy loading + fix a bunch of bugs, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 41d5d2dc55 19/30: Memoize type display name, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 870fdb519d 14/30: Optimize process of checking for/loading type dependencies, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect eec48eb6ea 28/30: Add test for update of method names in buffers + fix bug in completion, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect f1066c3c7f 29/30: Remove debug statements, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 223ca2bf54 12/30: Implement use of traits in live-edited buffers, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect b11d017702 01/30: Correctly index the name by which a function return type was referenced as used type, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 692711e34d 20/30: Implement property cells for more reliable property inheritance modeling, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 5f00c9ad8b 22/30: Fix compilation errors and fix tests for phpinspect-imports.el, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 2e6b0e9d2f 15/30: Make handling of corrupt index more robust + convert regexp to constant,
ELPA Syncer <=
- [elpa] externals/phpinspect 77bd3ebe90 27/30: Use `delete-char' instead of `delete-backward-char', ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect bf03a87c7f 17/30: Remove obsolete class test, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect b6978105e5 25/30: Fix: Don't discard first char after opening brace of class block, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect fe4f73661c 21/30: Make import removal configurable, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 5f44a51a75 16/30: Re-use last completion list when possible, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 9c0959a0df 11/30: Add some docstrings + a license header to phpinspect-typedef.el, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 52626b7091 18/30: Remove unused defun, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 4f85ef04a5 23/30: Remove debug statement, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 95a29a3982 30/30: Bump version to 2.0.0, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 9029072bc9 02/30: Fix bug in indexation of live edited buffer (function with preceding bareword in scope), ELPA Syncer, 2024/08/31