[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phpinspect 797efe9530 1/2: Only attempt to return compl
From: |
ELPA Syncer |
Subject: |
[elpa] externals/phpinspect 797efe9530 1/2: Only attempt to return completion kind when it can be found |
Date: |
Fri, 22 Mar 2024 12:58:58 -0400 (EDT) |
branch: externals/phpinspect
commit 797efe953028e6b2b1f7e7abe111123a1323b539
Author: Hugo Thunnissen <devel@hugot.nl>
Commit: Hugo Thunnissen <devel@hugot.nl>
Only attempt to return completion kind when it can be found
When completions aren't found this is probably the result of a bug, but
errors
in corfu's hooks are a pain for users so it is better to handle them
gracefully
---
phpinspect-completion.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/phpinspect-completion.el b/phpinspect-completion.el
index ad82e7c75f..63a63f0895 100644
--- a/phpinspect-completion.el
+++ b/phpinspect-completion.el
@@ -307,9 +307,13 @@ Returns list of `phpinspect--completion'."
(phpinspect--completion-target
comp))))
(insert ")")))))
:company-kind (lambda (comp-name)
- (phpinspect--completion-kind
- (phpinspect--completion-list-get-metadata
- phpinspect--last-completion-list
- comp-name))))))))
+ (let ((comp
+
(phpinspect--completion-list-get-metadata
+ phpinspect--last-completion-list
+ comp-name)))
+ (if comp
+ (phpinspect--completion-kind comp)
+ (phpinspect--log "Unable to find
matching completion for name %s" comp-name)
+ nil))))))))
(provide 'phpinspect-completion)