Skip to content

Commit

Permalink
fix: Allow glob-pattern from hash-table (#4427)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 authored Apr 15, 2024
1 parent 57d08cd commit 6ec1bc5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

Expand Down

0 comments on commit 6ec1bc5

Please sign in to comment.