add tests for rust context parsing, and update rust embedding query
Co-authored-by: maxbrunsfeld <max@zed.dev>
This commit is contained in:
parent
0a0e40fb24
commit
623cb9833c
3 changed files with 178 additions and 46 deletions
|
@ -81,7 +81,11 @@ impl CodeContextRetriever {
|
|||
|
||||
if let Some((item, byte_range)) = item.zip(byte_range) {
|
||||
if !name.is_empty() {
|
||||
let item = format!("{}\n{}", context_spans.join("\n"), item);
|
||||
let item = if context_spans.is_empty() {
|
||||
item.to_string()
|
||||
} else {
|
||||
format!("{}\n{}", context_spans.join("\n"), item)
|
||||
};
|
||||
|
||||
let document_text = CODE_CONTEXT_TEMPLATE
|
||||
.replace("<path>", relative_path.to_str().unwrap())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue