add embedding query for json with nested arrays and strings
Co-authored-by: maxbrunsfeld <max@zed.dev>
This commit is contained in:
parent
9809ec3d70
commit
efe973ebe2
7 changed files with 189 additions and 59 deletions
14
crates/zed/src/languages/json/embedding.scm
Normal file
14
crates/zed/src/languages/json/embedding.scm
Normal file
|
@ -0,0 +1,14 @@
|
|||
; Only produce one embedding for the entire file.
|
||||
(document) @item
|
||||
|
||||
; Collapse arrays, except for the first object.
|
||||
(array
|
||||
"[" @keep
|
||||
.
|
||||
(object)? @keep
|
||||
"]" @keep) @collapse
|
||||
|
||||
; Collapse string values (but not keys).
|
||||
(pair value: (string
|
||||
"\"" @keep
|
||||
"\"" @keep) @collapse)
|
Loading…
Add table
Add a link
Reference in a new issue