Skip to content

Commit bc46df5

Browse files
authored
handle relative glob pattern (#4777)
compatible with plist and ht also fix error in json schema
1 parent c77ba14 commit bc46df5

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

lsp-mode.el

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2997,11 +2997,11 @@ and end-of-string meta-characters."
29972997
(defun lsp-glob-to-regexps (glob-pattern)
29982998
"Convert a GLOB-PATTERN to a list of Elisp regexps."
29992999
(when-let*
3000-
((glob-pattern (cond ((hash-table-p glob-pattern)
3001-
(ht-get glob-pattern "pattern"))
3002-
((stringp glob-pattern) glob-pattern)
3003-
(t (error "Unknown glob-pattern type: %s" glob-pattern))))
3004-
(trimmed-pattern (string-trim glob-pattern))
3000+
((glob (pcase glob-pattern
3001+
((pred stringp) glob-pattern)
3002+
((lsp-interface RelativePattern :base-uri :pattern) (format "%s%s" base-uri pattern))
3003+
(_ (error "Unknown glob-pattern type: %s" glob-pattern))))
3004+
(trimmed-pattern (string-trim glob))
30053005
(top-level-unbraced-patterns (lsp-glob-unbrace-at-top-level trimmed-pattern)))
30063006
(seq-map #'lsp-glob-convert-to-wrapped-regexp
30073007
top-level-unbraced-patterns)))

lsp-protocol.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,7 @@ See `-let' for a description of the destructuring mechanism."
828828
(WillSaveTextDocumentParams (:reason :textDocument) nil)
829829
(WorkspaceSymbolParams (:query) nil)
830830
;; 3.17
831+
(RelativePattern (:baseUri :pattern) nil)
831832
(LabelDetails nil (:detail :description))
832833
(InlayHint (:label :position) (:kind :paddingLeft :paddingRight))
833834
(InlayHintLabelPart (:value) (:tooltip :location :command))

scripts/generated.protocol.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,7 @@
17371737
"type": "string"
17381738
}
17391739
},
1740-
"required": ["uri" "name"]
1740+
"required": ["uri", "name"]
17411741
},
17421742
"WorkspaceFoldersChangeEvent": {
17431743
"type": "object",

0 commit comments

Comments
 (0)