mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
parent
d54a262436
commit
67d9e7d011
4 changed files with 26 additions and 3 deletions
|
|
@ -78,3 +78,21 @@ def test_static_url_path():
|
|||
+ assert rv.status_code == 404
|
||||
+ rv.close()
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1376,8 +1376,13 @@
|
||||
-def test_static_file_not_found():
|
||||
- pass
|
||||
+def test_static_file_not_found(app, client):
|
||||
+ rv = client.get("/static/nonexistent.html")
|
||||
+ assert rv.status_code == 404
|
||||
+ assert rv.data.strip() == b"<h1>Not Found</h1>"
|
||||
+ with app.test_request_context():
|
||||
+ pytest.raises(BuildError, flask.url_for, "static", filename="nonexistent.html")
|
||||
+ rv.close()
|
||||
|
||||
|
||||
def test_static_url_path():
|
||||
```
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ revision = "24007727d42b4caceda3095ac685c463fae1ba1a"
|
|||
|
||||
fn language_for_id(&self, id: usize) -> LoaderResult<Language> {
|
||||
- let (path, language, externals) = &self.languages_by_id[id];
|
||||
+ let LanguageEntry { path, language, external_files } = &self.languages_by_id[id];
|
||||
+ let LanguageEntry { path, language, external_files } = &self.languages_by_id[id];
|
||||
language
|
||||
.get_or_try_init(|| {
|
||||
let src_path = path.join("src");
|
||||
|
|
|
|||
|
|
@ -211,12 +211,17 @@ impl TeacherPrompt {
|
|||
|
||||
pub fn parse(example: &Example, response: &str) -> Result<(String, Option<ActualCursor>)> {
|
||||
// Check if the model indicated no edits are needed
|
||||
let no_edits = (String::new(), None);
|
||||
if let Some(last_codeblock) = extract_last_codeblock(&response) {
|
||||
if last_codeblock.trim() == Self::NO_EDITS {
|
||||
return Ok((String::new(), None));
|
||||
return Ok(no_edits);
|
||||
}
|
||||
}
|
||||
|
||||
if response.trim().ends_with(Self::NO_EDITS) {
|
||||
return Ok(no_edits);
|
||||
}
|
||||
|
||||
// Extract updated (new) editable region from the model response.
|
||||
let new_editable_region = Self::extract_editable_region(&response)?;
|
||||
let cursor_offset = new_editable_region.find(Self::USER_CURSOR_MARKER);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ pub struct RepairArgs {
|
|||
|
||||
fn model_for_backend(backend: BatchProvider) -> &'static str {
|
||||
match backend {
|
||||
BatchProvider::Anthropic => "claude-sonnet-4-5",
|
||||
BatchProvider::Anthropic => "claude-sonnet-4-6",
|
||||
BatchProvider::Openai => "gpt-5.2",
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue