[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 2e249e5c24 4/8: Moved bookkeeping and imenu g
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 2e249e5c24 4/8: Moved bookkeeping and imenu generation to separate thread |
Date: |
Wed, 23 Mar 2022 12:27:10 -0400 (EDT) |
branch: externals/phps-mode
commit 2e249e5c24bba2e2266f5368bea10d9292263cbc
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Moved bookkeeping and imenu generation to separate thread
---
phps-mode-ast-bookkeeping.el | 6 +++---
phps-mode-ast-imenu.el | 9 +++++----
phps-mode-lex-analyzer.el | 12 ++++++++----
3 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/phps-mode-ast-bookkeeping.el b/phps-mode-ast-bookkeeping.el
index 79e83e00f0..ebff44a952 100644
--- a/phps-mode-ast-bookkeeping.el
+++ b/phps-mode-ast-bookkeeping.el
@@ -242,10 +242,10 @@
(push scope-string scope-strings)))
scope-strings))
-(defun phps-mode-ast-bookkeeping--generate ()
- "Generate AST for current buffer."
+(defun phps-mode-ast-bookkeeping--generate (&optional tree)
+ "Generate AST for current buffer or optionally for TREE."
(let ((bookkeeping (make-hash-table :test 'equal))
- (bookkeeping-stack phps-mode-ast--tree)
+ (bookkeeping-stack (if tree tree phps-mode-ast--tree))
(inline-function-count 0)
(arrow-function-count 0)
(defined-count 0))
diff --git a/phps-mode-ast-imenu.el b/phps-mode-ast-imenu.el
index 5afe86b339..e61e6bfe9d 100644
--- a/phps-mode-ast-imenu.el
+++ b/phps-mode-ast-imenu.el
@@ -16,10 +16,11 @@
nil
"Imenu for current buffer.")
-(defun phps-mode-ast-imenu--generate ()
- "Generate imenu from AST."
- (let ((imenu-index))
- (dolist (item phps-mode-ast--tree)
+(defun phps-mode-ast-imenu--generate (&optional tree)
+ "Generate imenu from current buffer AST or optionally from TREE."
+ (let ((imenu-index)
+ (ast-tree (if tree tree phps-mode-ast--tree)))
+ (dolist (item ast-tree)
(let ((children (plist-get item 'children))
(item-type (plist-get item 'ast-type))
(item-index (plist-get item 'index))
diff --git a/phps-mode-lex-analyzer.el b/phps-mode-lex-analyzer.el
index ffdbd7ec4b..1c807a1791 100644
--- a/phps-mode-lex-analyzer.el
+++ b/phps-mode-lex-analyzer.el
@@ -254,8 +254,10 @@
;; Catch errors in bookkeeping or imenu generation
(condition-case conditions
(progn
- (phps-mode-ast-bookkeeping--generate)
- (phps-mode-ast-imenu--generate))
+ (phps-mode-ast-bookkeeping--generate
+ phps-mode-lex-analyzer--ast)
+ (phps-mode-ast-imenu--generate
+ phps-mode-lex-analyzer--ast))
(error
(display-warning
'phps-mode
@@ -405,8 +407,10 @@
;; Catch errors in bookkeeping or imenu generation
(condition-case conditions
(progn
- (phps-mode-ast-bookkeeping--generate)
- (phps-mode-ast-imenu--generate))
+ (phps-mode-ast-bookkeeping--generate
+ phps-mode-lex-analyzer--ast)
+ (phps-mode-ast-imenu--generate
+ phps-mode-lex-analyzer--ast))
(error
(display-warning
'phps-mode
- [elpa] externals/phps-mode updated (246bcc6967 -> 3a09d15aa1), Christian Johansson, 2022/03/23
- [elpa] externals/phps-mode 3a09d15aa1 8/8: Updated version and changelog, Christian Johansson, 2022/03/23
- [elpa] externals/phps-mode d45658d99c 1/8: Starting experimenting with using two threads for serial commands, Christian Johansson, 2022/03/23
- [elpa] externals/phps-mode 9498a7ae53 7/8: Updated TODOs, Christian Johansson, 2022/03/23
- [elpa] externals/phps-mode b13cf27bf0 5/8: Removed unused variables, Christian Johansson, 2022/03/23
- [elpa] externals/phps-mode fd61209f54 3/8: Got serial multi-threading working with 2 separate threads instead of 1, Christian Johansson, 2022/03/23
- [elpa] externals/phps-mode 2e249e5c24 4/8: Moved bookkeeping and imenu generation to separate thread,
Christian Johansson <=
- [elpa] externals/phps-mode e0389c235f 6/8: Using separate error catching for imenu and bookkeeping generation, Christian Johansson, 2022/03/23
- [elpa] externals/phps-mode d6323a5548 2/8: Moved imenu and bookkeeping to main thread, Christian Johansson, 2022/03/23