From 6ec1bc5541c7bacc240448699d75ca0e12914810 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 15 Apr 2024 11:21:22 -0700 Subject: [PATCH] fix: Allow glob-pattern from hash-table (#4427) --- lsp-mode.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lsp-mode.el b/lsp-mode.el index acfa96fd92..e599af2def 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -2880,8 +2880,13 @@ and end-of-string meta-characters." (defun lsp-glob-to-regexps (glob-pattern) "Convert a GLOB-PATTERN to a list of Elisp regexps." - (let* ((trimmed-pattern (string-trim glob-pattern)) - (top-level-unbraced-patterns (lsp-glob-unbrace-at-top-level trimmed-pattern))) + (when-let* + ((glob-pattern (cond ((hash-table-p glob-pattern) + (ht-get glob-pattern "pattern")) + ((stringp glob-pattern) glob-pattern) + (t (error "Unknown glob-pattern type: %s" glob-pattern)))) + (trimmed-pattern (string-trim glob-pattern)) + (top-level-unbraced-patterns (lsp-glob-unbrace-at-top-level trimmed-pattern))) (seq-map #'lsp-glob-convert-to-wrapped-regexp top-level-unbraced-patterns)))