rename vector_store crate to semantic_index

This commit is contained in:
KCaverly 2023-07-17 17:06:10 -04:00
parent e630ff38c4
commit 8b42f5b1b3
14 changed files with 186 additions and 183 deletions

274
Cargo.lock generated
View File

@ -179,9 +179,9 @@ checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd"
[[package]]
name = "allocator-api2"
version = "0.2.15"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56fc6cf8dc8c4158eed8649f9b8b0ea1518eb62b544fe9490d66fa0b349eafe9"
checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5"
[[package]]
name = "alsa"
@ -277,9 +277,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.71"
version = "1.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8"
checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854"
[[package]]
name = "arrayref"
@ -481,7 +481,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.25",
"syn 2.0.26",
]
[[package]]
@ -529,7 +529,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.25",
"syn 2.0.26",
]
[[package]]
@ -572,7 +572,7 @@ checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.25",
"syn 2.0.26",
]
[[package]]
@ -680,7 +680,7 @@ dependencies = [
"http",
"http-body",
"hyper",
"itoa 1.0.8",
"itoa 1.0.9",
"matchit",
"memchr",
"mime",
@ -830,7 +830,7 @@ dependencies = [
"regex",
"rustc-hash",
"shlex",
"syn 2.0.25",
"syn 2.0.26",
"which",
]
@ -1243,20 +1243,20 @@ dependencies = [
[[package]]
name = "clap"
version = "4.3.11"
version = "4.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1640e5cc7fb47dbb8338fd471b105e7ed6c3cb2aeb00c2e067127ffd3764a05d"
checksum = "98330784c494e49850cb23b8e2afcca13587d2500b2e3f1f78ae20248059c9be"
dependencies = [
"clap_builder",
"clap_derive 4.3.2",
"clap_derive 4.3.12",
"once_cell",
]
[[package]]
name = "clap_builder"
version = "4.3.11"
version = "4.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98c59138d527eeaf9b53f35a77fcc1fad9d883116070c63d5de1c7dc7b00c72b"
checksum = "e182eb5f2562a67dda37e2c57af64d720a9e010c5e860ed87c056586aeafa52e"
dependencies = [
"anstream",
"anstyle",
@ -1279,14 +1279,14 @@ dependencies = [
[[package]]
name = "clap_derive"
version = "4.3.2"
version = "4.3.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f"
checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050"
dependencies = [
"heck 0.4.1",
"proc-macro2",
"quote",
"syn 2.0.25",
"syn 2.0.26",
]
[[package]]
@ -1357,7 +1357,7 @@ dependencies = [
"tiny_http",
"url",
"util",
"uuid 1.4.0",
"uuid 1.4.1",
]
[[package]]
@ -2204,9 +2204,9 @@ dependencies = [
[[package]]
name = "dyn-clone"
version = "1.0.11"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30"
checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272"
[[package]]
name = "editor"
@ -2319,9 +2319,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]]
name = "erased-serde"
version = "0.3.27"
version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f94c0e13118e7d7533271f754a168ae8400e6a1cc043f2bfd53cc7290f1a1de3"
checksum = "da96524cc884f6558f1769b6c46686af2fe8e8b4cd253bd5a3cdba8181b8e070"
dependencies = [
"serde",
]
@ -2789,7 +2789,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.25",
"syn 2.0.26",
]
[[package]]
@ -3033,7 +3033,7 @@ dependencies = [
"tiny-skia",
"usvg",
"util",
"uuid 1.4.0",
"uuid 1.4.1",
"waker-fn",
]
@ -3235,7 +3235,7 @@ checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482"
dependencies = [
"bytes 1.4.0",
"fnv",
"itoa 1.0.8",
"itoa 1.0.9",
]
[[package]]
@ -3294,7 +3294,7 @@ dependencies = [
"http-body",
"httparse",
"httpdate",
"itoa 1.0.8",
"itoa 1.0.9",
"pin-project-lite 0.2.10",
"socket2",
"tokio",
@ -3499,7 +3499,7 @@ dependencies = [
"rand 0.7.3",
"serde",
"tempfile",
"uuid 1.4.0",
"uuid 1.4.1",
"winapi 0.3.9",
]
@ -3576,9 +3576,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
[[package]]
name = "itoa"
version = "1.0.8"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a"
checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
[[package]]
name = "ittapi-rs"
@ -4722,7 +4722,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.25",
"syn 2.0.26",
]
[[package]]
@ -4886,9 +4886,9 @@ dependencies = [
[[package]]
name = "paste"
version = "1.0.13"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35"
checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
[[package]]
name = "pathfinder_color"
@ -4952,9 +4952,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
[[package]]
name = "pest"
version = "2.7.0"
version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f73935e4d55e2abf7f130186537b19e7a4abc886a0252380b59248af473a3fc9"
checksum = "0d2d1d55045829d65aad9d389139882ad623b33b904e7c9f1b10c5b8927298e5"
dependencies = [
"thiserror",
"ucd-trie",
@ -5010,7 +5010,7 @@ checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.25",
"syn 2.0.26",
]
[[package]]
@ -5163,7 +5163,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92139198957b410250d43fad93e630d956499a625c527eda65175c8680f83387"
dependencies = [
"proc-macro2",
"syn 2.0.25",
"syn 2.0.26",
]
[[package]]
@ -5211,9 +5211,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.64"
version = "1.0.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da"
checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9"
dependencies = [
"unicode-ident",
]
@ -5491,9 +5491,9 @@ dependencies = [
[[package]]
name = "quote"
version = "1.0.29"
version = "1.0.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105"
checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0"
dependencies = [
"proc-macro2",
]
@ -5879,7 +5879,7 @@ dependencies = [
"rkyv_derive",
"seahash",
"tinyvec",
"uuid 1.4.0",
"uuid 1.4.1",
]
[[package]]
@ -6034,7 +6034,7 @@ dependencies = [
"proc-macro2",
"quote",
"rust-embed-utils",
"syn 2.0.25",
"syn 2.0.26",
"walkdir",
]
@ -6097,7 +6097,7 @@ dependencies = [
"bitflags 1.3.2",
"errno 0.2.8",
"io-lifetimes 0.5.3",
"itoa 1.0.8",
"itoa 1.0.9",
"libc",
"linux-raw-sys 0.0.42",
"once_cell",
@ -6167,9 +6167,9 @@ dependencies = [
[[package]]
name = "rustversion"
version = "1.0.13"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f"
checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
[[package]]
name = "rustybuzz"
@ -6189,9 +6189,9 @@ dependencies = [
[[package]]
name = "ryu"
version = "1.0.14"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9"
checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
[[package]]
name = "safe_arch"
@ -6267,9 +6267,9 @@ checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8"
[[package]]
name = "scopeguard"
version = "1.1.0"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "scrypt"
@ -6329,7 +6329,7 @@ dependencies = [
"time 0.3.23",
"tracing",
"url",
"uuid 1.4.0",
"uuid 1.4.1",
]
[[package]]
@ -6355,7 +6355,7 @@ dependencies = [
"sea-query-derive",
"serde_json",
"time 0.3.23",
"uuid 1.4.0",
"uuid 1.4.1",
]
[[package]]
@ -6370,7 +6370,7 @@ dependencies = [
"serde_json",
"sqlx",
"time 0.3.23",
"uuid 1.4.0",
"uuid 1.4.1",
]
[[package]]
@ -6465,6 +6465,48 @@ dependencies = [
"libc",
]
[[package]]
name = "semantic_index"
version = "0.1.0"
dependencies = [
"anyhow",
"async-trait",
"bincode",
"ctor",
"editor",
"env_logger 0.9.3",
"futures 0.3.28",
"gpui",
"isahc",
"language",
"lazy_static",
"log",
"matrixmultiply",
"parking_lot 0.11.2",
"picker",
"project",
"rand 0.8.5",
"rpc",
"rusqlite",
"schemars",
"serde",
"serde_json",
"settings",
"smol",
"tempdir",
"theme",
"tiktoken-rs 0.5.0",
"tree-sitter",
"tree-sitter-cpp",
"tree-sitter-elixir 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tree-sitter-rust",
"tree-sitter-toml 0.20.0",
"tree-sitter-typescript 0.20.2 (registry+https://github.com/rust-lang/crates.io-index)",
"unindent",
"util",
"workspace",
]
[[package]]
name = "semver"
version = "0.11.0"
@ -6506,7 +6548,7 @@ checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.25",
"syn 2.0.26",
]
[[package]]
@ -6531,12 +6573,12 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.102"
version = "1.0.103"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5062a995d481b2308b6064e9af76011f2921c35f97b0468811ed9f6cd91dfed"
checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b"
dependencies = [
"indexmap 2.0.0",
"itoa 1.0.8",
"itoa 1.0.9",
"ryu",
"serde",
]
@ -6561,7 +6603,7 @@ checksum = "1d89a8107374290037607734c0b73a85db7ed80cae314b3c5791f192a496e731"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.25",
"syn 2.0.26",
]
[[package]]
@ -6571,7 +6613,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
dependencies = [
"form_urlencoded",
"itoa 1.0.8",
"itoa 1.0.9",
"ryu",
"serde",
]
@ -6702,9 +6744,9 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
[[package]]
name = "signal-hook"
version = "0.3.15"
version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9"
checksum = "b824b6e687aff278cdbf3b36f07aa52d4bd4099699324d5da86a2ebce3aa00b3"
dependencies = [
"libc",
"signal-hook-registry",
@ -6891,7 +6933,7 @@ dependencies = [
"parking_lot 0.11.2",
"smol",
"thread_local",
"uuid 1.4.0",
"uuid 1.4.1",
]
[[package]]
@ -6957,7 +6999,7 @@ dependencies = [
"hkdf",
"hmac 0.12.1",
"indexmap 1.9.3",
"itoa 1.0.8",
"itoa 1.0.9",
"libc",
"libsqlite3-sys",
"log",
@ -6983,7 +7025,7 @@ dependencies = [
"time 0.3.23",
"tokio-stream",
"url",
"uuid 1.4.0",
"uuid 1.4.1",
"webpki-roots 0.22.6",
"whoami",
]
@ -7041,9 +7083,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]]
name = "stringprep"
version = "0.1.2"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1"
checksum = "db3737bde7edce97102e0e2b15365bf7a20bfdb5f60f4f9e8d7004258a51a8da"
dependencies = [
"unicode-bidi",
"unicode-normalization",
@ -7103,7 +7145,7 @@ version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7dc09e9364c2045ab5fa38f7b04d077b3359d30c4c2b3ec4bae67a358bd64326"
dependencies = [
"itoa 1.0.8",
"itoa 1.0.9",
"ryu",
"sval",
]
@ -7114,7 +7156,7 @@ version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ada6f627e38cbb8860283649509d87bc4a5771141daa41c78fd31f2b9485888d"
dependencies = [
"itoa 1.0.8",
"itoa 1.0.9",
"ryu",
"sval",
]
@ -7229,9 +7271,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.25"
version = "2.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2"
checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970"
dependencies = [
"proc-macro2",
"quote",
@ -7485,7 +7527,7 @@ checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.25",
"syn 2.0.26",
]
[[package]]
@ -7562,7 +7604,7 @@ version = "0.3.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446"
dependencies = [
"itoa 1.0.8",
"itoa 1.0.9",
"serde",
"time-core",
"time-macros",
@ -7674,7 +7716,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.25",
"syn 2.0.26",
]
[[package]]
@ -7767,9 +7809,9 @@ checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b"
[[package]]
name = "toml_edit"
version = "0.19.12"
version = "0.19.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c500344a19072298cd05a7224b3c0c629348b78692bf48466c5238656e315a78"
checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a"
dependencies = [
"indexmap 2.0.0",
"toml_datetime",
@ -7879,7 +7921,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.25",
"syn 2.0.26",
]
[[package]]
@ -8285,9 +8327,9 @@ checksum = "7f9af028e052a610d99e066b33304625dea9613170a2563314490a4e6ec5cf7f"
[[package]]
name = "unicode-ident"
version = "1.0.10"
version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73"
checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c"
[[package]]
name = "unicode-normalization"
@ -8427,9 +8469,9 @@ checksum = "bcc7e3b898aa6f6c08e5295b6c89258d1331e9ac578cc992fb818759951bdc22"
[[package]]
name = "uuid"
version = "1.4.0"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d023da39d1fde5a8a3fe1f3e01ca9632ada0a63e9797de55a879d6e2236277be"
checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d"
dependencies = [
"getrandom 0.2.10",
"serde",
@ -8496,48 +8538,6 @@ dependencies = [
"workspace",
]
[[package]]
name = "vector_store"
version = "0.1.0"
dependencies = [
"anyhow",
"async-trait",
"bincode",
"ctor",
"editor",
"env_logger 0.9.3",
"futures 0.3.28",
"gpui",
"isahc",
"language",
"lazy_static",
"log",
"matrixmultiply",
"parking_lot 0.11.2",
"picker",
"project",
"rand 0.8.5",
"rpc",
"rusqlite",
"schemars",
"serde",
"serde_json",
"settings",
"smol",
"tempdir",
"theme",
"tiktoken-rs 0.5.0",
"tree-sitter",
"tree-sitter-cpp",
"tree-sitter-elixir 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tree-sitter-rust",
"tree-sitter-toml 0.20.0",
"tree-sitter-typescript 0.20.2 (registry+https://github.com/rust-lang/crates.io-index)",
"unindent",
"util",
"workspace",
]
[[package]]
name = "version_check"
version = "0.9.4"
@ -8698,7 +8698,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
"syn 2.0.25",
"syn 2.0.26",
"wasm-bindgen-shared",
]
@ -8732,7 +8732,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.25",
"syn 2.0.26",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@ -8745,9 +8745,9 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
[[package]]
name = "wasm-encoder"
version = "0.30.0"
version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2f8e9778e04cbf44f58acc301372577375a666b966c50b03ef46144f80436a8"
checksum = "06a3d1b4a575ffb873679402b2aedb3117555eb65c27b1b86c8a91e574bc2a2a"
dependencies = [
"leb128",
]
@ -8969,9 +8969,9 @@ dependencies = [
[[package]]
name = "wast"
version = "61.0.0"
version = "62.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc6b347851b52fd500657d301155c79e8c67595501d179cef87b6f04ebd25ac4"
checksum = "c7f7ee878019d69436895f019b65f62c33da63595d8e857cbdc87c13ecb29a32"
dependencies = [
"leb128",
"memchr",
@ -8981,11 +8981,11 @@ dependencies = [
[[package]]
name = "wat"
version = "1.0.67"
version = "1.0.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "459e764d27c3ab7beba1ebd617cc025c7e76dea6e7c5ce3189989a970aea3491"
checksum = "295572bf24aa5b685a971a83ad3e8b6e684aaad8a9be24bc7bf59bed84cc1c08"
dependencies = [
"wast 61.0.0",
"wast 62.0.0",
]
[[package]]
@ -9315,9 +9315,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
[[package]]
name = "winnow"
version = "0.4.9"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81a2094c43cc94775293eaa0e499fbc30048a6d824ac82c0351a8c0bf9112529"
checksum = "81fac9742fd1ad1bd9643b991319f72dd031016d44b77039a26977eb667141e7"
dependencies = [
"memchr",
]
@ -9399,7 +9399,7 @@ dependencies = [
"terminal",
"theme",
"util",
"uuid 1.4.0",
"uuid 1.4.1",
]
[[package]]
@ -9447,7 +9447,7 @@ name = "xtask"
version = "0.1.0"
dependencies = [
"anyhow",
"clap 4.3.11",
"clap 4.3.14",
"schemars",
"serde_json",
"theme",
@ -9548,6 +9548,7 @@ dependencies = [
"rsa",
"rust-embed",
"search",
"semantic_index",
"serde",
"serde_derive",
"serde_json",
@ -9589,8 +9590,7 @@ dependencies = [
"url",
"urlencoding",
"util",
"uuid 1.4.0",
"vector_store",
"uuid 1.4.1",
"vim",
"welcome",
"workspace",
@ -9621,7 +9621,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.25",
"syn 2.0.26",
]
[[package]]

View File

@ -63,7 +63,7 @@ members = [
"crates/theme",
"crates/theme_selector",
"crates/util",
"crates/vector_store",
"crates/semantic_index",
"crates/vim",
"crates/vcs_menu",
"crates/workspace",

View File

@ -291,8 +291,8 @@
// the terminal will default to matching the buffer's font family.
// "font_family": "Zed Mono"
},
// Difference settings for vector_store
"vector_store": {
// Difference settings for semantic_index
"semantic_index": {
"enabled": false,
"reindexing_delay_seconds": 600
},

View File

@ -1,11 +1,11 @@
[package]
name = "vector_store"
name = "semantic_index"
version = "0.1.0"
edition = "2021"
publish = false
[lib]
path = "src/vector_store.rs"
path = "src/semantic_index.rs"
doctest = false
[dependencies]

View File

@ -1,4 +1,4 @@
use crate::{parsing::Document, VECTOR_STORE_VERSION};
use crate::{parsing::Document, SEMANTIC_INDEX_VERSION};
use anyhow::{anyhow, Result};
use project::Fs;
use rpc::proto::Timestamp;
@ -55,7 +55,9 @@ impl VectorDatabase {
}
fn get_existing_version(&self) -> Result<i64> {
let mut version_query = self.db.prepare("SELECT version from vector_store_config")?;
let mut version_query = self
.db
.prepare("SELECT version from semantic_index_config")?;
version_query
.query_row([], |row| Ok(row.get::<_, i64>(0)?))
.map_err(|err| anyhow!("version query failed: {err}"))
@ -66,7 +68,7 @@ impl VectorDatabase {
if self
.get_existing_version()
.map_or(false, |version| version == VECTOR_STORE_VERSION as i64)
.map_or(false, |version| version == SEMANTIC_INDEX_VERSION as i64)
{
return Ok(());
}
@ -74,7 +76,7 @@ impl VectorDatabase {
self.db
.execute(
"
DROP TABLE vector_store_config;
DROP TABLE semantic_index_config;
DROP TABLE worktrees;
DROP TABLE files;
DROP TABLE documents;
@ -85,15 +87,15 @@ impl VectorDatabase {
// Initialize Vector Databasing Tables
self.db.execute(
"CREATE TABLE vector_store_config (
"CREATE TABLE semantic_index_config (
version INTEGER NOT NULL
)",
[],
)?;
self.db.execute(
"INSERT INTO vector_store_config (version) VALUES (?1)",
params![VECTOR_STORE_VERSION],
"INSERT INTO semantic_index_config (version) VALUES (?1)",
params![SEMANTIC_INDEX_VERSION],
)?;
self.db.execute(

View File

@ -1,4 +1,4 @@
use crate::{SearchResult, VectorStore};
use crate::{SearchResult, SemanticIndex};
use editor::{scroll::autoscroll::Autoscroll, Editor};
use gpui::{
actions, elements::*, AnyElement, AppContext, ModelHandle, MouseState, Task, ViewContext,
@ -20,7 +20,7 @@ pub type SemanticSearch = Picker<SemanticSearchDelegate>;
pub struct SemanticSearchDelegate {
workspace: WeakViewHandle<Workspace>,
project: ModelHandle<Project>,
vector_store: ModelHandle<VectorStore>,
semantic_index: ModelHandle<SemanticIndex>,
selected_match_index: usize,
matches: Vec<SearchResult>,
history: HashMap<String, Vec<SearchResult>>,
@ -33,12 +33,12 @@ impl SemanticSearchDelegate {
pub fn new(
workspace: WeakViewHandle<Workspace>,
project: ModelHandle<Project>,
vector_store: ModelHandle<VectorStore>,
semantic_index: ModelHandle<SemanticIndex>,
) -> Self {
Self {
workspace,
project,
vector_store,
semantic_index,
selected_match_index: 0,
matches: vec![],
history: HashMap::new(),
@ -105,7 +105,7 @@ impl PickerDelegate for SemanticSearchDelegate {
return Task::ready(());
}
let vector_store = self.vector_store.clone();
let semantic_index = self.semantic_index.clone();
let project = self.project.clone();
cx.spawn(|this, mut cx| async move {
cx.background().timer(EMBEDDING_DEBOUNCE_INTERVAL).await;
@ -123,7 +123,7 @@ impl PickerDelegate for SemanticSearchDelegate {
if let Some(retrieved) = retrieved_cached.log_err() {
if !retrieved {
let task = vector_store.update(&mut cx, |store, cx| {
let task = semantic_index.update(&mut cx, |store, cx| {
store.search_project(project.clone(), query.to_string(), 10, cx)
});

View File

@ -2,12 +2,12 @@ mod db;
mod embedding;
mod modal;
mod parsing;
mod vector_store_settings;
mod semantic_index_settings;
#[cfg(test)]
mod vector_store_tests;
mod semantic_index_tests;
use crate::vector_store_settings::VectorStoreSettings;
use crate::semantic_index_settings::SemanticIndexSettings;
use anyhow::{anyhow, Result};
use db::VectorDatabase;
use embedding::{EmbeddingProvider, OpenAIEmbeddings};
@ -40,7 +40,7 @@ use util::{
};
use workspace::{Workspace, WorkspaceCreated};
const VECTOR_STORE_VERSION: usize = 1;
const SEMANTIC_INDEX_VERSION: usize = 1;
const EMBEDDINGS_BATCH_SIZE: usize = 150;
pub fn init(
@ -49,7 +49,7 @@ pub fn init(
language_registry: Arc<LanguageRegistry>,
cx: &mut AppContext,
) {
settings::register::<VectorStoreSettings>(cx);
settings::register::<SemanticIndexSettings>(cx);
let db_file_path = EMBEDDINGS_DIR
.join(Path::new(RELEASE_CHANNEL_NAME.as_str()))
@ -58,14 +58,14 @@ pub fn init(
SemanticSearch::init(cx);
cx.add_action(
|workspace: &mut Workspace, _: &Toggle, cx: &mut ViewContext<Workspace>| {
if cx.has_global::<ModelHandle<VectorStore>>() {
let vector_store = cx.global::<ModelHandle<VectorStore>>().clone();
if cx.has_global::<ModelHandle<SemanticIndex>>() {
let semantic_index = cx.global::<ModelHandle<SemanticIndex>>().clone();
workspace.toggle_modal(cx, |workspace, cx| {
let project = workspace.project().clone();
let workspace = cx.weak_handle();
cx.add_view(|cx| {
SemanticSearch::new(
SemanticSearchDelegate::new(workspace, project, vector_store),
SemanticSearchDelegate::new(workspace, project, semantic_index),
cx,
)
})
@ -75,13 +75,14 @@ pub fn init(
);
if *RELEASE_CHANNEL == ReleaseChannel::Stable
|| !settings::get::<VectorStoreSettings>(cx).enabled
|| !settings::get::<SemanticIndexSettings>(cx).enabled
{
log::info!("NOT ENABLED");
return;
}
cx.spawn(move |mut cx| async move {
let vector_store = VectorStore::new(
let semantic_index = SemanticIndex::new(
fs,
db_file_path,
Arc::new(OpenAIEmbeddings {
@ -94,15 +95,15 @@ pub fn init(
.await?;
cx.update(|cx| {
cx.set_global(vector_store.clone());
cx.set_global(semantic_index.clone());
cx.subscribe_global::<WorkspaceCreated, _>({
let vector_store = vector_store.clone();
let semantic_index = semantic_index.clone();
move |event, cx| {
let workspace = &event.0;
if let Some(workspace) = workspace.upgrade(cx) {
let project = workspace.read(cx).project().clone();
if project.read(cx).is_local() {
vector_store.update(cx, |store, cx| {
semantic_index.update(cx, |store, cx| {
store.index_project(project, cx).detach();
});
}
@ -117,7 +118,7 @@ pub fn init(
.detach();
}
pub struct VectorStore {
pub struct SemanticIndex {
fs: Arc<dyn Fs>,
database_url: Arc<PathBuf>,
embedding_provider: Arc<dyn EmbeddingProvider>,
@ -220,7 +221,7 @@ enum EmbeddingJob {
Flush,
}
impl VectorStore {
impl SemanticIndex {
async fn new(
fs: Arc<dyn Fs>,
database_url: PathBuf,
@ -672,7 +673,7 @@ impl VectorStore {
}
}
impl Entity for VectorStore {
impl Entity for SemanticIndex {
type Event = ();
}

View File

@ -4,21 +4,21 @@ use serde::{Deserialize, Serialize};
use settings::Setting;
#[derive(Deserialize, Debug)]
pub struct VectorStoreSettings {
pub struct SemanticIndexSettings {
pub enabled: bool,
pub reindexing_delay_seconds: usize,
}
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug)]
pub struct VectorStoreSettingsContent {
pub struct SemanticIndexSettingsContent {
pub enabled: Option<bool>,
pub reindexing_delay_seconds: Option<usize>,
}
impl Setting for VectorStoreSettings {
const KEY: Option<&'static str> = Some("vector_store");
impl Setting for SemanticIndexSettings {
const KEY: Option<&'static str> = Some("semantic_index");
type FileContent = VectorStoreSettingsContent;
type FileContent = SemanticIndexSettingsContent;
fn load(
default_value: &Self::FileContent,

View File

@ -2,8 +2,8 @@ use crate::{
db::dot,
embedding::EmbeddingProvider,
parsing::{CodeContextRetriever, Document},
vector_store_settings::VectorStoreSettings,
VectorStore,
semantic_index_settings::SemanticIndexSettings,
SemanticIndex,
};
use anyhow::Result;
use async_trait::async_trait;
@ -30,10 +30,10 @@ fn init_logger() {
}
#[gpui::test]
async fn test_vector_store(cx: &mut TestAppContext) {
async fn test_semantic_index(cx: &mut TestAppContext) {
cx.update(|cx| {
cx.set_global(SettingsStore::test(cx));
settings::register::<VectorStoreSettings>(cx);
settings::register::<SemanticIndexSettings>(cx);
settings::register::<ProjectSettings>(cx);
});
@ -74,7 +74,7 @@ async fn test_vector_store(cx: &mut TestAppContext) {
let db_path = db_dir.path().join("db.sqlite");
let embedding_provider = Arc::new(FakeEmbeddingProvider::default());
let store = VectorStore::new(
let store = SemanticIndex::new(
fs.clone(),
db_path,
embedding_provider.clone(),

View File

@ -64,7 +64,7 @@ terminal_view = { path = "../terminal_view" }
theme = { path = "../theme" }
theme_selector = { path = "../theme_selector" }
util = { path = "../util" }
vector_store = { path = "../vector_store" }
semantic_index = { path = "../semantic_index" }
vim = { path = "../vim" }
workspace = { path = "../workspace" }
welcome = { path = "../welcome" }

View File

@ -157,7 +157,7 @@ fn main() {
project_panel::init(cx);
diagnostics::init(cx);
search::init(cx);
vector_store::init(fs.clone(), http.clone(), languages.clone(), cx);
semantic_index::init(fs.clone(), http.clone(), languages.clone(), cx);
vim::init(cx);
terminal_view::init(cx);
copilot::init(http.clone(), node_runtime, cx);