[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 72c692b511 210/212: Re-scan buffer interactiv
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 72c692b511 210/212: Re-scan buffer interactively now clears cache and kills running threads |
Date: |
Wed, 26 Jan 2022 01:51:29 -0500 (EST) |
branch: externals/phps-mode
commit 72c692b511866c85a27896da35416b0549da6f7c
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Re-scan buffer interactively now clears cache and kills running threads
---
TODO.md | 1 +
phps-mode-lex-analyzer.el | 25 ++++++++++++++++++-------
phps-mode.el | 2 +-
3 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/TODO.md b/TODO.md
index 340f3da32c..04ea30faeb 100644
--- a/TODO.md
+++ b/TODO.md
@@ -18,3 +18,4 @@
}
* Imenu-generation of conditionally defined functions and classes
+* Fix race-condition in incremental parser when running in threads
diff --git a/phps-mode-lex-analyzer.el b/phps-mode-lex-analyzer.el
index 6bdb59c020..b10b77fa93 100644
--- a/phps-mode-lex-analyzer.el
+++ b/phps-mode-lex-analyzer.el
@@ -95,20 +95,29 @@
;; FUNCTIONS
-(defun phps-mode-lex-analyzer--reset-local-variables ()
- "Reset local variables."
+(defun phps-mode-lex-analyzer--reset-local-variables (&optional clear-existing)
+ "Reset local variables, optionally CLEAR-EXISTING."
(setq phps-mode-lex-analyzer--allow-after-change-p t)
+ (setq phps-mode-lex-analyzer--ast nil)
(setq phps-mode-lex-analyzer--bookkeeping nil)
(setq phps-mode-lex-analyzer--change-min nil)
+ (setq phps-mode-lex-analyzer--heredoc-label nil)
(setq phps-mode-lex-analyzer--heredoc-label-stack nil)
(setq phps-mode-lex-analyzer--idle-timer nil)
(setq phps-mode-lex-analyzer--imenu nil)
+ (setq phps-mode-lex-analyzer--nest-location-stack nil)
+ (setq phps-mode-lex-analyzer--parse-error nil)
+ (setq phps-mode-lex-analyzer--parse-trail nil)
(setq phps-mode-lex-analyzer--processed-buffer-p nil)
(setq phps-mode-lex-analyzer--state nil)
(setq phps-mode-lex-analyzer--state-stack nil)
(setq phps-mode-lex-analyzer--states nil)
(setq phps-mode-lex-analyzer--tokens nil)
- (setq phps-mode-lex-analyzer--nest-location-stack nil))
+ (when clear-existing
+ (phps-mode-serial--kill-active (buffer-name))
+ (when buffer-file-name
+ (phps-mode-cache-delete buffer-file-name)))
+ )
(defun phps-mode-lex-analyzer--set-region-syntax-color (start end properties)
"Do syntax coloring for region START to END with PROPERTIES."
@@ -811,14 +820,15 @@
(if phps-mode-lex-analyzer--allow-after-change-p
(progn
- (phps-mode-debug-message (message "After change registration is
enabled"))
+ (phps-mode-debug-message
+ (message "After change registration is enabled"))
+ (phps-mode-serial--kill-active (buffer-name))
;; If we haven't scheduled incremental lexer before - do it
(when (and (boundp 'phps-mode-idle-interval)
phps-mode-idle-interval
(not phps-mode-lex-analyzer--idle-timer))
- (phps-mode-lex-analyzer--start-idle-timer)
- (phps-mode-serial--kill-active (buffer-name)))
+ (phps-mode-lex-analyzer--start-idle-timer))
(when (or
(not phps-mode-lex-analyzer--change-min)
@@ -829,7 +839,8 @@
(boundp 'phps-mode-idle-interval)
(not phps-mode-idle-interval))
(phps-mode-lex-analyzer--process-changes (current-buffer))))
- (phps-mode-debug-message (message "After change registration is
disabled"))))
+ (phps-mode-debug-message
+ (message "After change registration is disabled"))))
(defun phps-mode-lex-analyzer--imenu-create-index ()
"Get Imenu for current buffer."
diff --git a/phps-mode.el b/phps-mode.el
index 233e86faf2..a5e71ae583 100644
--- a/phps-mode.el
+++ b/phps-mode.el
@@ -78,7 +78,7 @@
(defun phps-mode-rescan-buffer ()
"Re-scan buffer."
(interactive)
- (phps-mode-lex-analyzer--reset-local-variables)
+ (phps-mode-lex-analyzer--reset-local-variables t)
(phps-mode-lex-analyzer--re2c-run))
;;;###autoload
- [elpa] externals/phps-mode c65d433a73 138/212: Improved indentation around multi-line function-calls, (continued)
- [elpa] externals/phps-mode c65d433a73 138/212: Improved indentation around multi-line function-calls, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode f537965850 168/212: Improved indentation on lines after lines that ends with semicolon, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 6d8544d7fa 171/212: Added two more failing tests for indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 616e3dc7ea 172/212: Added a TODO file, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d74686e07c 180/212: Started on optimizing lexer, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 06b35e4bf1 183/212: Fixed TODO item in this branch, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 40ecf58372 189/212: Adjustments for indent helper function determining last index line, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode edba476df8 191/212: Byte compilation fixes for indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 580298c395 201/212: Improved indentation of multi-line concatenated strings containing brackets, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 3e79319cf5 195/212: Added failing indent test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 72c692b511 210/212: Re-scan buffer interactively now clears cache and kills running threads,
Christian Johansson <=
- [elpa] externals/phps-mode 55d59ee365 207/212: More work on cache support, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 733f36a123 203/212: Added more failing indentation tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d4f0db2c0c 211/212: Added failing bookkeeping test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode cb4d95cd7a 204/212: Passed new indentation tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode a907f103f0 026/212: More work on AST for bookkeeping, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 95078e0db2 029/212: Added SDT for increment variable production, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d90b470109 035/212: Fixed bookkeeping of class property, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode bcf0c68945 038/212: AST-imenu and AST-bookkeeping now in standalone files, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 4e021b8413 046/212: Bookkeeping via AST now passing method calls, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 712f5e9f2b 049/212: Removed invalid syntax code from old bookkeeping test, Christian Johansson, 2022/01/26