logiguard fork: GPUI xdg-activation keyboard-focus serial fix
Some checks failed
Update All Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Triage Project Sync (#84) / Sync triage project (push) Has been cancelled
release_nightly / notify_on_failure (push) Has been cancelled
release_nightly / check_style (push) Has been cancelled
release_nightly / run_tests_windows (push) Has been cancelled
release_nightly / clippy_windows (push) Has been cancelled
release_nightly / bundle_linux_aarch64 (push) Has been cancelled
release_nightly / bundle_linux_x86_64 (push) Has been cancelled
release_nightly / bundle_mac_aarch64 (push) Has been cancelled
release_nightly / bundle_mac_x86_64 (push) Has been cancelled
release_nightly / bundle_windows_aarch64 (push) Has been cancelled
release_nightly / bundle_windows_x86_64 (push) Has been cancelled
release_nightly / build_nix_linux_x86_64 (push) Has been cancelled
release_nightly / build_nix_mac_aarch64 (push) Has been cancelled
release_nightly / update_nightly_tag (push) Has been cancelled
Hotfix Review Monitor / check-hotfix-reviews (push) Has been cancelled
Stale PR Review Reminder / check-stale-prs (push) Has been cancelled
Update Weekly Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Bump collab-staging Tag / update-collab-staging-tag (push) Has been cancelled
compliance_check / scheduled_compliance_check (push) Has been cancelled
Some checks failed
Update All Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Triage Project Sync (#84) / Sync triage project (push) Has been cancelled
release_nightly / notify_on_failure (push) Has been cancelled
release_nightly / check_style (push) Has been cancelled
release_nightly / run_tests_windows (push) Has been cancelled
release_nightly / clippy_windows (push) Has been cancelled
release_nightly / bundle_linux_aarch64 (push) Has been cancelled
release_nightly / bundle_linux_x86_64 (push) Has been cancelled
release_nightly / bundle_mac_aarch64 (push) Has been cancelled
release_nightly / bundle_mac_x86_64 (push) Has been cancelled
release_nightly / bundle_windows_aarch64 (push) Has been cancelled
release_nightly / bundle_windows_x86_64 (push) Has been cancelled
release_nightly / build_nix_linux_x86_64 (push) Has been cancelled
release_nightly / build_nix_mac_aarch64 (push) Has been cancelled
release_nightly / update_nightly_tag (push) Has been cancelled
Hotfix Review Monitor / check-hotfix-reviews (push) Has been cancelled
Stale PR Review Reminder / check-stale-prs (push) Has been cancelled
Update Weekly Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Bump collab-staging Tag / update-collab-staging-tag (push) Has been cancelled
compliance_check / scheduled_compliance_check (push) Has been cancelled
Single-commit orphan branch: full zed-industries/zed @ 8c74db0 source tree with a 3-file patch applied (no upstream history). Patch (crates/gpui_linux/src/linux/wayland/): - serial.rs: add SerialKind::KeyboardEnter - client.rs: store wl_keyboard.enter serial; add latest_serial_of() - window.rs: activate() uses keyboard-enter serial (Mutter focus gate) Mutter honors window activation only when the token carries the keyboard- focus serial from wl_keyboard.enter; GPUI used a stale mouse-press serial. See docs/tray-window-focus-wayland.md in logiguard. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
4
crates/edit_prediction_cli/evals/.zed/settings.json
Normal file
4
crates/edit_prediction_cli/evals/.zed/settings.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"remove_trailing_whitespace_on_save": false,
|
||||
"soft_wrap": "none",
|
||||
}
|
||||
69
crates/edit_prediction_cli/evals/codex-acp--add-derive.md
Normal file
69
crates/edit_prediction_cli/evals/codex-acp--add-derive.md
Normal file
@@ -0,0 +1,69 @@
|
||||
+++
|
||||
repository_url = "https://github.com/zed-industries/codex-acp"
|
||||
revision = "c3d24ee70928fc9da08c131fc632d624413ccc43"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/src/prompt_args.rs
|
||||
+++ b/src/prompt_args.rs
|
||||
@@ -28,7 +28,7 @@ impl PromptArgsError {
|
||||
}
|
||||
}
|
||||
|
||||
-#[derive(Debug)]
|
||||
+#[derive(Debug, Serialize)]
|
||||
pub enum PromptExpansionError {
|
||||
Args {
|
||||
command: String,
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```src/prompt_args.rs
|
||||
#[derive(Debug)]
|
||||
pub enum PromptArgsError {
|
||||
// ^[CURSOR_POSITION]
|
||||
MissingAssignment { token: String },
|
||||
MissingKey { token: String },
|
||||
}
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/src/prompt_args.rs
|
||||
+++ b/src/prompt_args.rs
|
||||
@@ -9,7 +9,7 @@ use std::sync::LazyLock;
|
||||
static PROMPT_ARG_REGEX: LazyLock<Regex> =
|
||||
LazyLock::new(|| Regex::new(r"\$[A-Z][A-Z0-9_]*").unwrap_or_else(|_| std::process::abort()));
|
||||
|
||||
-#[derive(Debug)]
|
||||
+#[derive(Debug, Serialize)]
|
||||
pub enum PromptArgsError {
|
||||
MissingAssignment { token: String },
|
||||
MissingKey { token: String },
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/src/prompt_args.rs
|
||||
+++ b/src/prompt_args.rs
|
||||
@@ -3,19 +3,20 @@
|
||||
use regex_lite::Regex;
|
||||
+use serde::Serialize;
|
||||
use shlex::Shlex;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::HashSet;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
static PROMPT_ARG_REGEX: LazyLock<Regex> =
|
||||
LazyLock::new(|| Regex::new(r"\$[A-Z][A-Z0-9_]*").unwrap_or_else(|_| std::process::abort()));
|
||||
|
||||
-#[derive(Debug)]
|
||||
+#[derive(Debug, Serialize)]
|
||||
pub enum PromptArgsError {
|
||||
MissingAssignment { token: String },
|
||||
MissingKey { token: String },
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,98 @@
|
||||
+++
|
||||
repository_url = "https://github.com/pallets/flask"
|
||||
revision = "2fec0b206c6e83ea813ab26597e15c96fab08be7"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1376,5 +1376,8 @@
|
||||
def test_static_files(app, client):
|
||||
rv = client.get("/static/index.html")
|
||||
assert rv.status_code == 200
|
||||
assert rv.data.strip() == b"<h1>Hello World!</h1>"
|
||||
with app.test_request_context():
|
||||
assert flask.url_for("static", filename="index.html") == "/static/index.html"
|
||||
rv.close()
|
||||
|
||||
|
||||
+de
|
||||
+
|
||||
+
|
||||
def test_static_url_path():
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1372,15 +1372,15 @@
|
||||
-de
|
||||
+def test_():
|
||||
+ pass
|
||||
|
||||
|
||||
def test_static_url_path():
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1372,15 +1372,15 @@
|
||||
-def test_():
|
||||
+def test_static_file_not_found():
|
||||
pass
|
||||
|
||||
|
||||
def test_static_url_path():
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```tests/test_basic.py
|
||||
def test_static_file_not_found():
|
||||
# ^[CURSOR_POSITION]
|
||||
pass
|
||||
|
||||
|
||||
def test_static_url_path():
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1372,15 +1372,15 @@
|
||||
-def test_static_file_not_found():
|
||||
- pass
|
||||
+def test_static_file_not_found(app, client):
|
||||
+ rv = client.get("/static/non_existent.html")
|
||||
+ assert rv.status_code == 404
|
||||
+ rv.close()
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1372,15 +1372,15 @@
|
||||
-def test_static_file_not_found():
|
||||
- pass
|
||||
+def test_static_file_not_found(app, client):
|
||||
+ rv = client.get("/static/not_found.html")
|
||||
+ 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():
|
||||
```
|
||||
@@ -0,0 +1,76 @@
|
||||
+++
|
||||
repository_url = "https://github.com/pallets/flask"
|
||||
revision = "2fec0b206c6e83ea813ab26597e15c96fab08be7"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/src/flask/logging.py
|
||||
+++ b/src/flask/logging.py
|
||||
@@ -4,7 +4,7 @@
|
||||
import sys
|
||||
import typing as t
|
||||
|
||||
-from werkzeug.local import LocalProxy
|
||||
+imfrom werkzeug.local import LocalProxy
|
||||
|
||||
from .globals import request
|
||||
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```src/flask/logging.py
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import sys
|
||||
import typing as t
|
||||
|
||||
imfrom werkzeug.local import LocalProxy
|
||||
# ^[CURSOR_POSITION]
|
||||
|
||||
from .globals import request
|
||||
|
||||
if t.TYPE_CHECKING: # pragma: no cover
|
||||
from .sansio.app import App
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/src/flask/logging.py
|
||||
+++ b/src/flask/logging.py
|
||||
@@ -1,21 +1,21 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import sys
|
||||
import typing as t
|
||||
|
||||
-imfrom werkzeug.local import LocalProxy
|
||||
+import
|
||||
# ^[CURSOR_POSITION]
|
||||
+from werkzeug.local import LocalProxy
|
||||
|
||||
from .globals import request
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/src/flask/logging.py
|
||||
+++ b/src/flask/logging.py
|
||||
@@ -1,21 +1,21 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import sys
|
||||
import typing as t
|
||||
-
|
||||
-imfrom werkzeug.local import LocalProxy
|
||||
+import werkzeug
|
||||
# ^[CURSOR_POSITION]
|
||||
+from werkzeug.local import LocalProxy
|
||||
|
||||
from .globals import request
|
||||
```
|
||||
177
crates/edit_prediction_cli/evals/flask--add-test-function.md
Normal file
177
crates/edit_prediction_cli/evals/flask--add-test-function.md
Normal file
@@ -0,0 +1,177 @@
|
||||
+++
|
||||
repository_url = "https://github.com/pallets/flask"
|
||||
revision = "2fec0b206c6e83ea813ab26597e15c96fab08be7"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1376,5 +1376,8 @@
|
||||
def test_static_files(app, client):
|
||||
rv = client.get("/static/index.html")
|
||||
assert rv.status_code == 200
|
||||
assert rv.data.strip() == b"<h1>Hello World!</h1>"
|
||||
with app.test_request_context():
|
||||
assert flask.url_for("static", filename="index.html") == "/static/index.html"
|
||||
rv.close()
|
||||
|
||||
|
||||
+de
|
||||
+
|
||||
+
|
||||
def test_static_url_path():
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```tests/test_basic.py
|
||||
def test_static_files(app, client):
|
||||
rv = client.get("/static/index.html")
|
||||
assert rv.status_code == 200
|
||||
assert rv.data.strip() == b"<h1>Hello World!</h1>"
|
||||
with app.test_request_context():
|
||||
assert flask.url_for("static", filename="index.html") == "/static/index.html"
|
||||
rv.close()
|
||||
|
||||
|
||||
de
|
||||
# ^[CURSOR_POSITION]
|
||||
|
||||
|
||||
def test_static_url_path():
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1372,15 +1372,15 @@
|
||||
-de
|
||||
+def test_():
|
||||
# ^[CURSOR_POSITION]
|
||||
+
|
||||
|
||||
|
||||
def test_static_url_path():
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1372,15 +1372,15 @@
|
||||
-de
|
||||
+def test_():
|
||||
# ^[CURSOR_POSITION]
|
||||
+ pass
|
||||
|
||||
|
||||
def test_static_url_path():
|
||||
```
|
||||
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1372,15 +1372,15 @@
|
||||
-de
|
||||
+def test_(app, client):
|
||||
# ^[CURSOR_POSITION]
|
||||
+
|
||||
|
||||
|
||||
def test_static_url_path():
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1372,15 +1372,15 @@
|
||||
-de
|
||||
+def test_(app, client):
|
||||
# ^[CURSOR_POSITION]
|
||||
+ pass
|
||||
|
||||
|
||||
def test_static_url_path():
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1372,15 +1372,15 @@
|
||||
-de
|
||||
+def test_static_():
|
||||
# ^[CURSOR_POSITION]
|
||||
+
|
||||
|
||||
|
||||
def test_static_url_path():
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1372,15 +1372,15 @@
|
||||
-de
|
||||
+def test_static_():
|
||||
# ^[CURSOR_POSITION]
|
||||
+ pass
|
||||
|
||||
|
||||
def test_static_url_path():
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1372,15 +1372,15 @@
|
||||
-de
|
||||
+def test_static_(app, client):
|
||||
# ^[CURSOR_POSITION]
|
||||
+
|
||||
|
||||
|
||||
def test_static_url_path():
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1372,15 +1372,15 @@
|
||||
-de
|
||||
+def test_static_(app, client):
|
||||
# ^[CURSOR_POSITION]
|
||||
+ pass
|
||||
|
||||
|
||||
def test_static_url_path():
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1372,15 +1372,15 @@
|
||||
-de
|
||||
+def test_static_folder():
|
||||
# ^[CURSOR_POSITION]
|
||||
+ pass
|
||||
|
||||
|
||||
def test_static_url_path():
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -1372,15 +1372,15 @@
|
||||
-de
|
||||
+def test_static_route_with_host_matching(app, client):
|
||||
+
|
||||
# ^[CURSOR_POSITION]
|
||||
|
||||
|
||||
def test_static_url_path():
|
||||
```
|
||||
@@ -0,0 +1,98 @@
|
||||
+++
|
||||
repository_url = "https://github.com/pallets/flask"
|
||||
revision = "2fec0b206c6e83ea813ab26597e15c96fab08be7"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -356,3 +356,6 @@
|
||||
cookie = rv.headers["set-cookie"].lower()
|
||||
assert "samesite=lax" in cookie
|
||||
|
||||
|
||||
+de
|
||||
+
|
||||
+
|
||||
def test_missing_session(app):
|
||||
```
|
||||
|
||||
// User accepted prediction:
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -358,6 +358,14 @@
|
||||
|
||||
|
||||
-de
|
||||
+def test_session_cookie_httponly(app, client):
|
||||
+ app.config["SESSION_COOKIE_HTTPONLY"] = True
|
||||
+
|
||||
+ @app.route("/")
|
||||
+ def index():
|
||||
+ flask.session["testing"] = 42
|
||||
+ return "Hello World"
|
||||
+
|
||||
+ rv = client.get("/")
|
||||
+ assert "httponly" in rv.headers["set-cookie"].lower()
|
||||
|
||||
|
||||
def test_missing_session(app):
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -358,14 +358,14 @@
|
||||
|
||||
|
||||
-def test_session_cookie_httponly(app, client):
|
||||
+def test_session_cookie_secur(app, client):
|
||||
app.config["SESSION_COOKIE_HTTPONLY"] = True
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```tests/test_basic.py
|
||||
cookie = rv.headers["set-cookie"].lower()
|
||||
assert "samesite=lax" in cookie
|
||||
|
||||
|
||||
def test_session_cookie_secur(app, client):
|
||||
# ^[CURSOR_POSITION]
|
||||
app.config["SESSION_COOKIE_HTTPONLY"] = True
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
flask.session["testing"] = 42
|
||||
return "Hello World"
|
||||
|
||||
rv = client.get("/")
|
||||
assert "httponly" in rv.headers["set-cookie"].lower()
|
||||
|
||||
|
||||
def test_missing_session(app):
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/tests/test_basic.py
|
||||
+++ b/tests/test_basic.py
|
||||
@@ -358,14 +358,14 @@
|
||||
-def test_session_cookie_secur(app, client):
|
||||
- app.config["SESSION_COOKIE_HTTPONLY"] = True
|
||||
+def test_session_cookie_secure(app, client):
|
||||
+ app.config["SESSION_COOKIE_SECURE"] = True
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
flask.session["testing"] = 42
|
||||
return "Hello World"
|
||||
|
||||
rv = client.get("/")
|
||||
- assert "httponly" in rv.headers["set-cookie"].lower()
|
||||
+ assert "secure" in rv.headers["set-cookie"].lower()
|
||||
```
|
||||
@@ -0,0 +1,81 @@
|
||||
+++
|
||||
repository_url = "https://github.com/octocat/hello-world"
|
||||
revision = "7fd1a60b01f91b314f59955a4e4d4e80d8edf11d"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/README
|
||||
+++ b/README
|
||||
@@ -1,1 +1,6 @@
|
||||
-Hello World!
|
||||
+function filterByStatus(items, status) {
|
||||
+ return items.filter(item => item.status === status);
|
||||
+}
|
||||
+
|
||||
+function groupBy
|
||||
+
|
||||
```
|
||||
|
||||
// User accepted prediction:
|
||||
```diff
|
||||
--- a/README
|
||||
+++ b/README
|
||||
@@ -4,3 +4,9 @@
|
||||
|
||||
-function groupBy
|
||||
+function groupByStatus(items) {
|
||||
+ return items.reduce((groups, item) => {
|
||||
+ const key = item.status;
|
||||
+ (groups[key] = groups[key] || []).push(item);
|
||||
+ return groups;
|
||||
+ }, {});
|
||||
+}
|
||||
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/README
|
||||
+++ b/README
|
||||
@@ -4,4 +4,4 @@
|
||||
|
||||
-function groupByStatus(items) {
|
||||
+function groupByCat(items) {
|
||||
return items.reduce((groups, item) => {
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```README
|
||||
function filterByStatus(items, status) {
|
||||
return items.filter(item => item.status === status);
|
||||
}
|
||||
|
||||
function groupByCat(items) {
|
||||
# ^[CURSOR_POSITION]
|
||||
return items.reduce((groups, item) => {
|
||||
const key = item.status;
|
||||
(groups[key] = groups[key] || []).push(item);
|
||||
return groups;
|
||||
}, {});
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/README
|
||||
+++ b/README
|
||||
@@ -5,7 +5,7 @@
|
||||
-function groupByCat(items) {
|
||||
+function groupByCategory(items) {
|
||||
# ^[CURSOR_POSITION]
|
||||
return items.reduce((groups, item) => {
|
||||
- const key = item.status;
|
||||
+ const key = item.category;
|
||||
(groups[key] = groups[key] || []).push(item);
|
||||
return groups;
|
||||
}, {});
|
||||
```
|
||||
140
crates/edit_prediction_cli/evals/terraform--add-comment.md
Normal file
140
crates/edit_prediction_cli/evals/terraform--add-comment.md
Normal file
@@ -0,0 +1,140 @@
|
||||
+++
|
||||
repository_url = "https://github.com/hashicorp/terraform"
|
||||
revision = "a3dc571150a7651a1a4a8b302342d26089c97795"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/internal/actions/actions.go
|
||||
+++ b/internal/actions/actions.go
|
||||
@@ -63,6 +63,7 @@
|
||||
a.mu.Lock()
|
||||
defer a.mu.Unlock()
|
||||
|
||||
+ /
|
||||
result := []addrs.AbsActionInstance{}
|
||||
for _, data := range a.actionInstances.Elements() {
|
||||
if data.Key.ContainingAction().Equal(addr) {
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```internal/actions/actions.go
|
||||
defer a.mu.Unlock()
|
||||
|
||||
data, ok := a.actionInstances.GetOk(addr)
|
||||
|
||||
if !ok {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
return &data, true
|
||||
}
|
||||
|
||||
func (a *Actions) GetActionInstanceKeys(addr addrs.AbsAction) []addrs.AbsActionInstance {
|
||||
a.mu.Lock()
|
||||
defer a.mu.Unlock()
|
||||
|
||||
/
|
||||
// <[CURSOR_POSITION]
|
||||
result := []addrs.AbsActionInstance{}
|
||||
for _, data := range a.actionInstances.Elements() {
|
||||
if data.Key.ContainingAction().Equal(addr) {
|
||||
result = append(result, data.Key)
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/internal/actions/actions.go
|
||||
+++ b/internal/actions/actions.go
|
||||
@@ -51,26 +51,26 @@
|
||||
func (a *Actions) GetActionInstanceKeys(addr addrs.AbsAction) []addrs.AbsActionInstance {
|
||||
a.mu.Lock()
|
||||
defer a.mu.Unlock()
|
||||
|
||||
- /
|
||||
+ // Filter action instances by the given action.
|
||||
result := []addrs.AbsActionInstance{}
|
||||
for _, data := range a.actionInstances.Elements() {
|
||||
if data.Key.ContainingAction().Equal(addr) {
|
||||
result = append(result, data.Key)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/internal/actions/actions.go
|
||||
+++ b/internal/actions/actions.go
|
||||
@@ -54,25 +54,25 @@
|
||||
func (a *Actions) GetActionInstanceKeys(addr addrs.AbsAction) []addrs.AbsActionInstance {
|
||||
a.mu.Lock()
|
||||
defer a.mu.Unlock()
|
||||
|
||||
- /
|
||||
+ // Filter action instances that belong to the given action
|
||||
result := []addrs.AbsActionInstance{}
|
||||
for _, data := range a.actionInstances.Elements() {
|
||||
if data.Key.ContainingAction().Equal(addr) {
|
||||
result = append(result, data.Key)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/internal/actions/actions.go
|
||||
+++ b/internal/actions/actions.go
|
||||
@@ -54,25 +54,25 @@
|
||||
func (a *Actions) GetActionInstanceKeys(addr addrs.AbsAction) []addrs.AbsActionInstance {
|
||||
a.mu.Lock()
|
||||
defer a.mu.Unlock()
|
||||
|
||||
- /
|
||||
+ // Iterate through all action instances and filter by the containing action
|
||||
result := []addrs.AbsActionInstance{}
|
||||
for _, data := range a.actionInstances.Elements() {
|
||||
if data.Key.ContainingAction().Equal(addr) {
|
||||
result = append(result, data.Key)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/internal/actions/actions.go
|
||||
+++ b/internal/actions/actions.go
|
||||
func (a *Actions) GetActionInstanceKeys(addr addrs.AbsAction) []addrs.AbsActionInstance {
|
||||
a.mu.Lock()
|
||||
defer a.mu.Unlock()
|
||||
|
||||
- /
|
||||
+ // Iterate through all action instances and return those that belong to the given action
|
||||
result := []addrs.AbsActionInstance{}
|
||||
for _, data := range a.actionInstances.Elements() {
|
||||
if data.Key.ContainingAction().Equal(addr) {
|
||||
result = append(result, data.Key)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/internal/actions/actions.go
|
||||
+++ b/internal/actions/actions.go
|
||||
func (a *Actions) GetActionInstanceKeys(addr addrs.AbsAction) []addrs.AbsActionInstance {
|
||||
a.mu.Lock()
|
||||
defer a.mu.Unlock()
|
||||
|
||||
- /
|
||||
+ // Collect all action instances that belong to the given action
|
||||
result := []addrs.AbsActionInstance{}
|
||||
for _, data := range a.actionInstances.Elements() {
|
||||
if data.Key.ContainingAction().Equal(addr) {
|
||||
result = append(result, data.Key)
|
||||
}
|
||||
}
|
||||
```
|
||||
136
crates/edit_prediction_cli/evals/tree-sitter--if-let-to-match.md
Normal file
136
crates/edit_prediction_cli/evals/tree-sitter--if-let-to-match.md
Normal file
@@ -0,0 +1,136 @@
|
||||
+++
|
||||
repository_url = "git@github.com:tree-sitter/tree-sitter"
|
||||
revision = "17e3c7a5c56527a179fa6e37ce7ee934493e5047"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/crates/loader/src/loader.rs
|
||||
+++ b/crates/loader/src/loader.rs
|
||||
@@ -729,15 +729,16 @@
|
||||
));
|
||||
}
|
||||
for parser_container_dir in &config.parser_directories {
|
||||
- if let Ok(entries) = fs::read_dir(parser_container_dir) {
|
||||
- for entry in entries {
|
||||
- let entry = entry.map_err(|e| LoaderError::IO(IoError::new(e, None)))?;
|
||||
- if let Some(parser_dir_name) = entry.file_name().to_str() {
|
||||
- if parser_dir_name.starts_with("tree-sitter-") {
|
||||
- self.find_language_configurations_at_path(
|
||||
- &parser_container_dir.join(parser_dir_name),
|
||||
- false,
|
||||
- )
|
||||
+ match fs::read_dir(parser_container_dir) {
|
||||
+ Ok(entries) => {
|
||||
+ for entry in entries {
|
||||
+ let entry = entry.map_err(|e| LoaderError::IO(IoError::new(e, None)))?;
|
||||
+ if let Some(parser_dir_name) = entry.file_name().to_str() {
|
||||
+ if parser_dir_name.starts_with("tree-sitter-") {
|
||||
+ self.find_language_configurations_at_path(
|
||||
+ &parser_container_dir.join(parser_dir_name),
|
||||
+ false,
|
||||
+ )
|
||||
.ok();
|
||||
}
|
||||
}
|
||||
--- a/crates/loader/src/loader.rs
|
||||
+++ b/crates/loader/src/loader.rs
|
||||
@@ -739,7 +739,8 @@
|
||||
&parser_container_dir.join(parser_dir_name),
|
||||
false,
|
||||
)
|
||||
- .ok();
|
||||
+ .ok();
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```crates/loader/src/loader.rs
|
||||
if let Some(parser_dir_name) = entry.file_name().to_str() {
|
||||
if parser_dir_name.starts_with("tree-sitter-") {
|
||||
self.find_language_configurations_at_path(
|
||||
&parser_container_dir.join(parser_dir_name),
|
||||
false,
|
||||
)
|
||||
.ok();
|
||||
}
|
||||
// ^[CURSOR_POSITION]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/crates/loader/src/loader.rs
|
||||
+++ b/crates/loader/src/loader.rs
|
||||
@@ -736,13 +736,13 @@
|
||||
if let Some(parser_dir_name) = entry.file_name().to_str() {
|
||||
if parser_dir_name.starts_with("tree-sitter-") {
|
||||
self.find_language_configurations_at_path(
|
||||
&parser_container_dir.join(parser_dir_name),
|
||||
false,
|
||||
)
|
||||
.ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+ Err(error) => {}
|
||||
# ^[CURSOR_POSITION]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/crates/loader/src/loader.rs
|
||||
+++ b/crates/loader/src/loader.rs
|
||||
@@ -736,13 +736,13 @@
|
||||
if let Some(parser_dir_name) = entry.file_name().to_str() {
|
||||
if parser_dir_name.starts_with("tree-sitter-") {
|
||||
self.find_language_configurations_at_path(
|
||||
&parser_container_dir.join(parser_dir_name),
|
||||
false,
|
||||
)
|
||||
.ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+ Err(_) => {}
|
||||
# ^[CURSOR_POSITION]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
```diff
|
||||
--- a/crates/loader/src/loader.rs
|
||||
+++ b/crates/loader/src/loader.rs
|
||||
@@ -736,13 +736,13 @@
|
||||
if let Some(parser_dir_name) = entry.file_name().to_str() {
|
||||
if parser_dir_name.starts_with("tree-sitter-") {
|
||||
self.find_language_configurations_at_path(
|
||||
&parser_container_dir.join(parser_dir_name),
|
||||
false,
|
||||
)
|
||||
.ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+ Err(e) => {
|
||||
+
|
||||
# ^[CURSOR_POSITION]
|
||||
+ }
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,125 @@
|
||||
+++
|
||||
repository_url = "git@github.com:tree-sitter/tree-sitter"
|
||||
revision = "24007727d42b4caceda3095ac685c463fae1ba1a"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -604,7 +604,7 @@
|
||||
|
||||
pub struct Loader {
|
||||
pub parser_lib_path: PathBuf,
|
||||
- languages_by_id: Vec<(PathBuf, OnceCell<Language>, Option<Vec<PathBuf>>)>,
|
||||
+ languages_by_id: Vec<LanguageEntry>,
|
||||
language_configurations: Vec<LanguageConfiguration<'static>>,
|
||||
language_configuration_ids_by_file_type: HashMap<String, Vec<usize>>,
|
||||
language_configuration_in_current_path: Option<usize>,
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -621,6 +621,8 @@
|
||||
wasm_store: Mutex<Option<tree_sitter::WasmStore>>,
|
||||
}
|
||||
|
||||
+str
|
||||
pub struct CompileConfig<'a> {
|
||||
pub src_path: &'a Path,
|
||||
pub header_paths: Vec<&'a Path>,
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```tree-sitter/crates/loader/src/loader.rs
|
||||
sanitize_build: bool,
|
||||
force_rebuild: bool,
|
||||
|
||||
#[cfg(feature = "wasm")]
|
||||
wasm_store: Mutex<Option<tree_sitter::WasmStore>>,
|
||||
}
|
||||
|
||||
str
|
||||
// ^[CURSOR_POSITION]
|
||||
pub struct CompileConfig<'a> {
|
||||
pub src_path: &'a Path,
|
||||
pub header_paths: Vec<&'a Path>,
|
||||
pub parser_path: PathBuf,
|
||||
pub scanner_path: Option<PathBuf>,
|
||||
pub external_files: Option<&'a [PathBuf]>,
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -621,6 +621,8 @@
|
||||
wasm_store: Mutex<Option<tree_sitter::WasmStore>>,
|
||||
}
|
||||
|
||||
-str
|
||||
+struct LanguageEntry {
|
||||
+ path: PathBuf,
|
||||
+ language: OnceCell<Language>,
|
||||
+ external_files: Option<Vec<PathBuf>>,
|
||||
+}
|
||||
+
|
||||
pub struct CompileConfig<'a> {
|
||||
pub src_path: &'a Path,
|
||||
pub header_paths: Vec<&'a Path>,
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -621,6 +621,8 @@
|
||||
wasm_store: Mutex<Option<tree_sitter::WasmStore>>,
|
||||
}
|
||||
|
||||
-str
|
||||
+struct LanguageEntry {
|
||||
+ path: PathBuf,
|
||||
+ language: OnceCell<Language>,
|
||||
+ dependencies: Option<Vec<PathBuf>>,
|
||||
+}
|
||||
+
|
||||
pub struct CompileConfig<'a> {
|
||||
pub src_path: &'a Path,
|
||||
pub header_paths: Vec<&'a Path>,
|
||||
```
|
||||
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -621,6 +621,8 @@
|
||||
wasm_store: Mutex<Option<tree_sitter::WasmStore>>,
|
||||
}
|
||||
|
||||
-str
|
||||
+struct LanguageEntry {
|
||||
+ path: PathBuf,
|
||||
+ language: OnceCell<Language>,
|
||||
+ extra_files: Option<Vec<PathBuf>>,
|
||||
+}
|
||||
+
|
||||
pub struct CompileConfig<'a> {
|
||||
pub src_path: &'a Path,
|
||||
pub header_paths: Vec<&'a Path>,
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -621,6 +621,8 @@
|
||||
wasm_store: Mutex<Option<tree_sitter::WasmStore>>,
|
||||
}
|
||||
|
||||
-str
|
||||
+struct LanguageEntry(PathBuf, OnceCell<Language>, Option<Vec<PathBuf>>);
|
||||
+
|
||||
pub struct CompileConfig<'a> {
|
||||
pub src_path: &'a Path,
|
||||
pub header_paths: Vec<&'a Path>,
|
||||
```
|
||||
@@ -0,0 +1,153 @@
|
||||
+++
|
||||
repository_url = "git@github.com:tree-sitter/tree-sitter"
|
||||
revision = "24007727d42b4caceda3095ac685c463fae1ba1a"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -604,7 +604,7 @@
|
||||
|
||||
pub struct Loader {
|
||||
pub parser_lib_path: PathBuf,
|
||||
- languages_by_id: Vec<(PathBuf, OnceCell<Language>, Option<Vec<PathBuf>>)>,
|
||||
+ languages_by_id: Vec<LanguageEntry>,
|
||||
language_configurations: Vec<LanguageConfiguration<'static>>,
|
||||
language_configuration_ids_by_file_type: HashMap<String, Vec<usize>>,
|
||||
language_configuration_in_current_path: Option<usize>,
|
||||
@@ -619,6 +619,12 @@
|
||||
|
||||
#[cfg(feature = "wasm")]
|
||||
wasm_store: Mutex<Option<tree_sitter::WasmStore>>,
|
||||
}
|
||||
+
|
||||
+struct LanguageEntry {
|
||||
+ path: PathBuf,
|
||||
+ language: OnceCell<Language>,
|
||||
+ external_files: Option<Vec<PathBuf>>,
|
||||
+}
|
||||
|
||||
pub struct CompileConfig<'a> {
|
||||
@@ -767,7 +773,7 @@
|
||||
pub fn get_all_language_configurations(&self) -> Vec<(&LanguageConfiguration, &Path)> {
|
||||
self.language_configurations
|
||||
.iter()
|
||||
- .map(|c| (c, self.languages_by_id[c.language_id].0.as_ref()))
|
||||
+ .map(|c| (c, self.languages_by_id[c.language_id].path.as_ref()))
|
||||
.collect()
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```tree-sitter/crates/loader/src/loader.rs
|
||||
fn language_for_id(&self, id: usize) -> LoaderResult<Language> {
|
||||
let (path, language, externals) = &self.languages_by_id[id];
|
||||
// ^[CURSOR_POSITION]
|
||||
language
|
||||
.get_or_try_init(|| {
|
||||
let src_path = path.join("src");
|
||||
self.load_language_at_path(CompileConfig::new(
|
||||
&src_path,
|
||||
externals.as_deref(),
|
||||
None,
|
||||
))
|
||||
})
|
||||
.cloned()
|
||||
}
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -926,7 +926,11 @@
|
||||
}
|
||||
|
||||
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];
|
||||
language
|
||||
.get_or_try_init(|| {
|
||||
let src_path = path.join("src");
|
||||
self.load_language_at_path(CompileConfig::new(
|
||||
&src_path,
|
||||
- externals.as_deref(),
|
||||
+ external_files.as_deref(),
|
||||
None,
|
||||
))
|
||||
})
|
||||
.cloned()
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -926,7 +926,11 @@
|
||||
}
|
||||
|
||||
fn language_for_id(&self, id: usize) -> LoaderResult<Language> {
|
||||
- let (path, language, externals) = &self.languages_by_id[id];
|
||||
+ let LanguageEntry {
|
||||
+ path,
|
||||
+ language,
|
||||
+ external_files: externals,
|
||||
+ } = &self.languages_by_id[id];
|
||||
language
|
||||
.get_or_try_init(|| {
|
||||
let src_path = path.join("src");
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -926,13 +926,14 @@
|
||||
}
|
||||
|
||||
fn language_for_id(&self, id: usize) -> LoaderResult<Language> {
|
||||
- let (path, language, externals) = &self.languages_by_id[id];
|
||||
- language
|
||||
+ let entry = &self.languages_by_id[id];
|
||||
+ entry
|
||||
+ .language
|
||||
.get_or_try_init(|| {
|
||||
- let src_path = path.join("src");
|
||||
+ let src_path = entry.path.join("src");
|
||||
self.load_language_at_path(CompileConfig::new(
|
||||
&src_path,
|
||||
- externals.as_deref(),
|
||||
+ entry.external_files.as_deref(),
|
||||
None,
|
||||
))
|
||||
})
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -926,0 +926,0 @@
|
||||
}
|
||||
|
||||
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];
|
||||
language
|
||||
.get_or_try_init(|| {
|
||||
let src_path = path.join("src");
|
||||
self.load_language_at_path(CompileConfig::new(
|
||||
&src_path,
|
||||
- externals.as_deref(),
|
||||
+ external_files.as_deref(),
|
||||
None,
|
||||
))
|
||||
})
|
||||
.cloned()
|
||||
```
|
||||
@@ -0,0 +1,62 @@
|
||||
+++
|
||||
repository_url = "git@github.com:tree-sitter/tree-sitter"
|
||||
revision = "24007727d42b4caceda3095ac685c463fae1ba1a"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -604,7 +604,7 @@
|
||||
|
||||
pub struct Loader {
|
||||
pub parser_lib_path: PathBuf,
|
||||
- languages_by_id: Vec<(PathBuf, OnceCell<Language>, Option<Vec<PathBuf>>)>,
|
||||
+ languages_by_id: Vec<LanguageEntry>,
|
||||
language_configurations: Vec<LanguageConfiguration<'static>>,
|
||||
language_configuration_ids_by_file_type: HashMap<String, Vec<usize>>,
|
||||
language_configuration_in_current_path: Option<usize>,
|
||||
@@ -619,6 +619,12 @@
|
||||
|
||||
#[cfg(feature = "wasm")]
|
||||
wasm_store: Mutex<Option<tree_sitter::WasmStore>>,
|
||||
}
|
||||
+
|
||||
+struct LanguageEntry {
|
||||
+ path: PathBuf,
|
||||
+ language: OnceCell<Language>,
|
||||
+ external_files: Option<Vec<PathBuf>>,
|
||||
+}
|
||||
|
||||
pub struct CompileConfig<'a> {
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```tree-sitter/crates/loader/src/loader.rs
|
||||
#[must_use]
|
||||
pub fn get_all_language_configurations(&self) -> Vec<(&LanguageConfiguration, &Path)> {
|
||||
self.language_configurations
|
||||
.iter()
|
||||
.map(|c| (c, self.languages_by_id[c.language_id].0.as_ref()))
|
||||
// ^[CURSOR_POSITION]
|
||||
.collect()
|
||||
}
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -773,7 +773,7 @@
|
||||
pub fn get_all_language_configurations(&self) -> Vec<(&LanguageConfiguration, &Path)> {
|
||||
self.language_configurations
|
||||
.iter()
|
||||
- .map(|c| (c, self.languages_by_id[c.language_id].0.as_ref()))
|
||||
+ .map(|c| (c, self.languages_by_id[c.language_id].path.as_ref()))
|
||||
.collect()
|
||||
}
|
||||
|
||||
```
|
||||
@@ -0,0 +1,106 @@
|
||||
+++
|
||||
repository_url = "git@github.com:tree-sitter/tree-sitter"
|
||||
revision = "24007727d42b4caceda3095ac685c463fae1ba1a"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -604,7 +604,7 @@
|
||||
|
||||
pub struct Loader {
|
||||
pub parser_lib_path: PathBuf,
|
||||
- languages_by_id: Vec<(PathBuf, OnceCell<Language>, Option<Vec<PathBuf>>)>,
|
||||
+ languages_by_id: Vec<LanguageEntry>,
|
||||
language_configurations: Vec<LanguageConfiguration<'static>>,
|
||||
language_configuration_ids_by_file_type: HashMap<String, Vec<usize>>,
|
||||
language_configuration_in_current_path: Option<usize>,
|
||||
@@ -619,6 +619,12 @@
|
||||
|
||||
#[cfg(feature = "wasm")]
|
||||
wasm_store: Mutex<Option<tree_sitter::WasmStore>>,
|
||||
}
|
||||
+
|
||||
+struct LanguageEntry {
|
||||
+ path: PathBuf,
|
||||
+ language: OnceCell<Language>,
|
||||
+ external_files: Option<Vec<PathBuf>>,
|
||||
+}
|
||||
|
||||
pub struct CompileConfig<'a> {
|
||||
@@ -767,7 +773,7 @@
|
||||
pub fn get_all_language_configurations(&self) -> Vec<(&LanguageConfiguration, &Path)> {
|
||||
self.language_configurations
|
||||
.iter()
|
||||
- .map(|c| (c, self.languages_by_id[c.language_id].0.as_ref()))
|
||||
+ .map(|c| (c, self.languages_by_id[c.language_id].path.as_ref()))
|
||||
.collect()
|
||||
}
|
||||
|
||||
@@ -920,7 +926,11 @@
|
||||
}
|
||||
|
||||
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];
|
||||
language
|
||||
.get_or_try_init(|| {
|
||||
let src_path = path.join("src");
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```tree-sitter/crates/loader/src/loader.rs
|
||||
let mut language_id = None;
|
||||
for (id, (path, _, _)) in
|
||||
// ^[CURSOR_POSITION]
|
||||
self.languages_by_id.iter().enumerate().skip(language_count)
|
||||
{
|
||||
if language_path == *path {
|
||||
language_id = Some(id);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -1542,8 +1542,7 @@
|
||||
// Determine if a previous language configuration in this package.json file
|
||||
// already uses the same language.
|
||||
let mut language_id = None;
|
||||
- for (id, (path, _, _)) in
|
||||
- self.languages_by_id.iter().enumerate().skip(language_count)
|
||||
+ for (id, entry) in self.languages_by_id.iter().enumerate().skip(language_count)
|
||||
{
|
||||
- if language_path == *path {
|
||||
+ if language_path == entry.path {
|
||||
language_id = Some(id);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -1542,8 +1542,7 @@
|
||||
// Determine if a previous language configuration in this package.json file
|
||||
// already uses the same language.
|
||||
let mut language_id = None;
|
||||
- for (id, (path, _, _)) in
|
||||
+ for (id, LanguageEntry { path, .. }) in
|
||||
self.languages_by_id.iter().enumerate().skip(language_count)
|
||||
{
|
||||
if language_path == *path {
|
||||
language_id = Some(id);
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,144 @@
|
||||
+++
|
||||
repository_url = "git@github.com:tree-sitter/tree-sitter"
|
||||
revision = "24007727d42b4caceda3095ac685c463fae1ba1a"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -604,7 +604,7 @@
|
||||
|
||||
pub struct Loader {
|
||||
pub parser_lib_path: PathBuf,
|
||||
- languages_by_id: Vec<(PathBuf, OnceCell<Language>, Option<Vec<PathBuf>>)>,
|
||||
+ languages_by_id: Vec<LanguageEntry>,
|
||||
language_configurations: Vec<LanguageConfiguration<'static>>,
|
||||
language_configuration_ids_by_file_type: HashMap<String, Vec<usize>>,
|
||||
language_configuration_in_current_path: Option<usize>,
|
||||
@@ -619,6 +619,12 @@
|
||||
|
||||
#[cfg(feature = "wasm")]
|
||||
wasm_store: Mutex<Option<tree_sitter::WasmStore>>,
|
||||
+}
|
||||
+
|
||||
+struct LanguageEntry {
|
||||
+ path: PathBuf,
|
||||
+ language: OnceCell<Language>,
|
||||
+ external_files: Option<Vec<PathBuf>>,
|
||||
}
|
||||
|
||||
pub struct CompileConfig<'a> {
|
||||
@@ -767,7 +773,7 @@
|
||||
pub fn get_all_language_configurations(&self) -> Vec<(&LanguageConfiguration, &Path)> {
|
||||
self.language_configurations
|
||||
.iter()
|
||||
- .map(|c| (c, self.languages_by_id[c.language_id].0.as_ref()))
|
||||
+ .map(|c| (c, self.languages_by_id[c.language_id].path.as_ref()))
|
||||
.collect()
|
||||
}
|
||||
|
||||
@@ -920,13 +926,17 @@
|
||||
}
|
||||
|
||||
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];
|
||||
language
|
||||
.get_or_try_init(|| {
|
||||
let src_path = path.join("src");
|
||||
self.load_language_at_path(CompileConfig::new(
|
||||
&src_path,
|
||||
- externals.as_deref(),
|
||||
+ external_files.as_deref(),
|
||||
None,
|
||||
))
|
||||
})
|
||||
@@ -1532,10 +1542,9 @@
|
||||
// Determine if a previous language configuration in this package.json file
|
||||
// already uses the same language.
|
||||
let mut language_id = None;
|
||||
- for (id, (path, _, _)) in
|
||||
- self.languages_by_id.iter().enumerate().skip(language_count)
|
||||
+ for (id, entry) in self.languages_by_id.iter().enumerate().skip(language_count)
|
||||
{
|
||||
- if language_path == *path {
|
||||
+ if language_path == entry.path {
|
||||
language_id = Some(id);
|
||||
}
|
||||
}
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -1553,10 +1553,10 @@
|
||||
let language_id = if let Some(language_id) = language_id {
|
||||
language_id
|
||||
} else {
|
||||
- self.languages_by_id.push((
|
||||
- language_path,
|
||||
- OnceCell::new(),
|
||||
- grammar
|
||||
+ self.languages_by_id.push(LanguageEntry {
|
||||
+ path: language_path,
|
||||
+ language: OnceCell::new(),
|
||||
+ external_files: grammar
|
||||
.external_files
|
||||
.clone()
|
||||
.into_vec()
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```tree-sitter/crates/loader/src/loader.rs
|
||||
let language_id = if let Some(language_id) = language_id {
|
||||
language_id
|
||||
} else {
|
||||
self.languages_by_id.push(LanguageEntry {
|
||||
path: language_path,
|
||||
language: OnceCell::new(),
|
||||
external_files: grammar
|
||||
.external_files
|
||||
.clone()
|
||||
.into_vec()
|
||||
.map(|files| {
|
||||
files
|
||||
.into_iter()
|
||||
.map(|path| {
|
||||
let path = parser_path.join(path);
|
||||
// prevent p being above/outside of parser_path
|
||||
if path.starts_with(parser_path) {
|
||||
Ok(path)
|
||||
} else {
|
||||
Err(LoaderError::ExternalFile(
|
||||
path.to_string_lossy().to_string(),
|
||||
parser_path.to_string_lossy().to_string(),
|
||||
))
|
||||
}
|
||||
})
|
||||
.collect::<LoaderResult<Vec<_>>>()
|
||||
})
|
||||
.transpose()?,
|
||||
// ^[CURSOR_POSITION]
|
||||
));
|
||||
self.languages_by_id.len() - 1
|
||||
};
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/tree-sitter/crates/loader/src/loader.rs
|
||||
+++ b/tree-sitter/crates/loader/src/loader.rs
|
||||
@@ -1578,7 +1578,7 @@
|
||||
.collect::<LoaderResult<Vec<_>>>()
|
||||
})
|
||||
.transpose()?,
|
||||
- ));
|
||||
+ });
|
||||
self.languages_by_id.len() - 1
|
||||
};
|
||||
```
|
||||
@@ -0,0 +1,88 @@
|
||||
+++
|
||||
repository_url = "https://github.com/microsoft/vscode"
|
||||
revision = "29e6da6efa2287aaa981635a475d425ff4fd5d5c"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/src/vs/workbench/contrib/debug/browser/debugCommands.ts
|
||||
+++ b/src/vs/workbench/contrib/debug/browser/debugCommands.ts
|
||||
@@ -304,8 +304,8 @@ CommandsRegistry.registerCommand({
|
||||
|
||||
CommandsRegistry.registerCommand({
|
||||
id: REVERSE_CONTINUE_ID,
|
||||
- handler: (accessor: ServicesAccessor, _: string, context: CallStackContext | unknown) => {
|
||||
- getThreadAndRun(accessor, context, thread => thread.reverseContinue());
|
||||
+ handler: async (accessor: ServicesAccessor, _: string, context: CallStackContext | unknown) => {
|
||||
+ await getThreadAndRun(accessor, context, thread => thread.reverseContinue());
|
||||
}
|
||||
});
|
||||
--- a/src/vs/workbench/contrib/debug/browser/debugCommands.ts
|
||||
+++ b/src/vs/workbench/contrib/debug/browser/debugCommands.ts
|
||||
@@ -311,11 +311,11 @@ CommandsRegistry.registerCommand({
|
||||
|
||||
CommandsRegistry.registerCommand({
|
||||
id: STEP_BACK_ID,
|
||||
- handler: (accessor: ServicesAccessor, _: string, context: CallStackContext | unknown) => {
|
||||
+ handler: async (accessor: ServicesAccessor, _: string, context: CallStackContext | unknown) => {
|
||||
const contextKeyService = accessor.get(IContextKeyService);
|
||||
if (CONTEXT_DISASSEMBLY_VIEW_FOCUS.getValue(contextKeyService)) {
|
||||
- getThreadAndRun(accessor, context, (thread: IThread) => thread.stepBack('instruction'));
|
||||
+ await getThreadAndRun(accessor, context, (thread: IThread) => thread.stepBack('instruction'));
|
||||
} else {
|
||||
- getThreadAndRun(accessor, context, (thread: IThread) => thread.stepBack());
|
||||
+ await getThreadAndRun(accessor, context, (thread: IThread) => thread.stepBack());
|
||||
}
|
||||
}
|
||||
});
|
||||
--- a/src/vs/workbench/contrib/debug/browser/debugCommands.ts
|
||||
+++ b/src/vs/workbench/contrib/debug/browser/debugCommands.ts
|
||||
@@ -323,8 +323,8 @@ CommandsRegistry.registerCommand({
|
||||
|
||||
CommandsRegistry.registerCommand({
|
||||
id: TERMINATE_THREAD_ID,
|
||||
- handler: (accessor: ServicesAccessor, _: string, context: CallStackContext | unknown) => {
|
||||
- getThreadAndRun(accessor, context, thread => thread.terminate());
|
||||
+ handler: async (accessor: ServicesAccessor, _: string, context: CallStackContext | unknown) => {
|
||||
+ await getThreadAndRun(accessor, context, thread => thread.terminate());
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```src/vs/workbench/contrib/debug/browser/debugCommands.ts
|
||||
weight: KeybindingWeight.WorkbenchContrib,
|
||||
primary: isWeb ? (KeyMod.Alt | KeyCode.F10) : KeyCode.F10, // Browsers do not allow F10 to be binded so we have to bind an alternative
|
||||
when: CONTEXT_DEBUG_STATE.isEqualTo('stopped'),
|
||||
handler: (accessor: ServicesAccessor, _: string, context: CallStackContext | unknown) => {
|
||||
// ^[CURSOR_POSITION]
|
||||
const contextKeyService = accessor.get(IContextKeyService);
|
||||
if (CONTEXT_DISASSEMBLY_VIEW_FOCUS.getValue(contextKeyService)) {
|
||||
getThreadAndRun(accessor, context, (thread: IThread) => thread.next('instruction'));
|
||||
} else {
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/src/vs/workbench/contrib/debug/browser/debugCommands.ts
|
||||
+++ b/src/vs/workbench/contrib/debug/browser/debugCommands.ts
|
||||
@@ -467,10 +467,10 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
weight: KeybindingWeight.WorkbenchContrib,
|
||||
primary: isWeb ? (KeyMod.Alt | KeyCode.F10) : KeyCode.F10, // Browsers do not allow F10 to be binded so we have to bind an alternative
|
||||
when: CONTEXT_DEBUG_STATE.isEqualTo('stopped'),
|
||||
- handler: (accessor: ServicesAccessor, _: string, context: CallStackContext | unknown) => {
|
||||
+ handler: async (accessor: ServicesAccessor, _: string, context: CallStackContext | unknown) => {
|
||||
const contextKeyService = accessor.get(IContextKeyService);
|
||||
if (CONTEXT_DISASSEMBLY_VIEW_FOCUS.getValue(contextKeyService)) {
|
||||
- getThreadAndRun(accessor, context, (thread: IThread) => thread.next('instruction'));
|
||||
+ await getThreadAndRun(accessor, context, (thread: IThread) => thread.next('instruction'));
|
||||
} else {
|
||||
- getThreadAndRun(accessor, context, (thread: IThread) => thread.next());
|
||||
+ await getThreadAndRun(accessor, context, (thread: IThread) => thread.next());
|
||||
}
|
||||
}
|
||||
});
|
||||
```
|
||||
@@ -0,0 +1,74 @@
|
||||
+++
|
||||
repository_url = "https://github.com/microsoft/vscode"
|
||||
revision = "6f6e26fcdf0a7ca5084e0da284cd7a5b2d41ae4d"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/src/vs/workbench/api/common/extHostTypes.ts
|
||||
+++ b/src/vs/workbench/api/common/extHostTypes.ts
|
||||
@@ -18,6 +18,14 @@ import { FileSystemProviderErrorCode, markAsFileSystemProviderError } from 'vs/
|
||||
import type * as vscode from 'vscode';
|
||||
|
||||
+function es5ClassCompat(target: Function): any {
|
||||
+ ///@ts-expect-error
|
||||
+ function _() { return Reflect.construct(target, arguments, this.constructor); }
|
||||
+ Object.defineProperty(_, 'name', Object.getOwnPropertyDescriptor(target, 'name')!);
|
||||
+ Object.setPrototypeOf(_, target);
|
||||
+ Object.setPrototypeOf(_.prototype, target.prototype);
|
||||
+ return _;
|
||||
+}
|
||||
+
|
||||
+@es5ClassCompat
|
||||
export class Disposable {
|
||||
--- a/src/vs/workbench/api/common/extHostTypes.ts
|
||||
+++ b/src/vs/workbench/api/common/extHostTypes.ts
|
||||
@@ -50,6 +58,7 @@ export class Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
+@es5ClassCompat
|
||||
export class Position {
|
||||
|
||||
static Min(...positions: Position[]): Position {
|
||||
--- a/src/vs/workbench/api/common/extHostTypes.ts
|
||||
+++ b/src/vs/workbench/api/common/extHostTypes.ts
|
||||
@@ -220,6 +229,7 @@ export class Position {
|
||||
}
|
||||
}
|
||||
|
||||
+@es5ClassCompat
|
||||
export class Range {
|
||||
|
||||
static isRange(thing: any): thing is vscode.Range {
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```src/vs/workbench/api/common/extHostTypes.ts
|
||||
Prepend = 3
|
||||
}
|
||||
|
||||
export class TextEdit {
|
||||
// <[CURSOR_POSITION]
|
||||
|
||||
static isTextEdit(thing: any): thing is TextEdit {
|
||||
if (thing instanceof TextEdit) {
|
||||
return true;
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/src/vs/workbench/api/common/extHostTypes.ts
|
||||
+++ b/src/vs/workbench/api/common/extHostTypes.ts
|
||||
@@ -475,6 +485,7 @@ export enum EnvironmentVariableMutatorType {
|
||||
Prepend = 3
|
||||
}
|
||||
|
||||
+@es5ClassCompat
|
||||
export class TextEdit {
|
||||
|
||||
static isTextEdit(thing: any): thing is TextEdit {
|
||||
```
|
||||
113
crates/edit_prediction_cli/evals/vscode--add-interface-method.md
Normal file
113
crates/edit_prediction_cli/evals/vscode--add-interface-method.md
Normal file
@@ -0,0 +1,113 @@
|
||||
+++
|
||||
repository_url = "https://github.com/microsoft/vscode"
|
||||
revision = "b64eaf598008e2d600a81d846108f72cb37b48e2"
|
||||
+++
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/src/vs/platform/window/electron-main/window.ts
|
||||
+++ b/src/vs/platform/window/electron-main/window.ts
|
||||
@@ -1,49 +1,50 @@
|
||||
export interface ICodeWindow extends IDisposable {
|
||||
|
||||
readonly onWillLoad: Event<ILoadEvent>;
|
||||
readonly onDidSignalReady: Event<void>;
|
||||
+ readonly onDidTriggerSystemContextMenu: Event<{ x: number; y: number }>;
|
||||
readonly onDidClose: Event<void>;
|
||||
readonly onDidDestroy: Event<void>;
|
||||
|
||||
readonly whenClosedOrLoaded: Promise<void>;
|
||||
--- a/src/vs/platform/windows/electron-main/window.ts
|
||||
+++ b/src/vs/platform/windows/electron-main/window.ts
|
||||
@@ -63,60 +63,63 @@ const enum ReadyState {
|
||||
export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
|
||||
//#region Events
|
||||
|
||||
private readonly _onWillLoad = this._register(new Emitter<ILoadEvent>());
|
||||
readonly onWillLoad = this._onWillLoad.event;
|
||||
|
||||
private readonly _onDidSignalReady = this._register(new Emitter<void>());
|
||||
readonly onDidSignalReady = this._onDidSignalReady.event;
|
||||
|
||||
+ private readonly _onDidTriggerSystemContextMenu = this._register(new Emitter<{ x: number; y: number }>());
|
||||
+ readonly onDidTriggerSystemContextMenu = this._onDidTriggerSystemContextMenu.event;
|
||||
+
|
||||
private readonly _onDidClose = this._register(new Emitter<void>());
|
||||
readonly onDidClose = this._onDidClose.event;
|
||||
|
||||
private readonly _onDidDestroy = this._register(new Emitter<void>());
|
||||
readonly onDidDestroy = this._onDidDestroy.event;
|
||||
|
||||
//#endregion
|
||||
--- a/src/vs/platform/windows/electron-main/windows.ts
|
||||
+++ b/src/vs/platform/windows/electron-main/windows.ts
|
||||
@@ -1,54 +1,55 @@
|
||||
export interface IWindowsMainService {
|
||||
|
||||
readonly _serviceBrand: undefined;
|
||||
|
||||
readonly onDidChangeWindowsCount: Event<IWindowsCountChangedEvent>;
|
||||
|
||||
readonly onDidOpenWindow: Event<ICodeWindow>;
|
||||
readonly onDidSignalReadyWindow: Event<ICodeWindow>;
|
||||
+ readonly onDidTriggerSystemContextMenu: Event<{ window: ICodeWindow; x: number; y: number }>;
|
||||
readonly onDidDestroyWindow: Event<ICodeWindow>;
|
||||
--- a/src/vs/platform/windows/electron-main/windowsMainService.ts
|
||||
+++ b/src/vs/platform/windows/electron-main/windowsMainService.ts
|
||||
@@ -160,60 +160,63 @@ interface ISingleFolderWorkspacePathToOpen extends IPathToOpen {
|
||||
export class WindowsMainService extends Disposable implements IWindowsMainService {
|
||||
|
||||
declare readonly _serviceBrand: undefined;
|
||||
|
||||
private static readonly WINDOWS: ICodeWindow[] = [];
|
||||
|
||||
private readonly _onDidOpenWindow = this._register(new Emitter<ICodeWindow>());
|
||||
readonly onDidOpenWindow = this._onDidOpenWindow.event;
|
||||
|
||||
private readonly _onDidSignalReadyWindow = this._register(new Emitter<ICodeWindow>());
|
||||
readonly onDidSignalReadyWindow = this._onDidSignalReadyWindow.event;
|
||||
|
||||
private readonly _onDidDestroyWindow = this._register(new Emitter<ICodeWindow>());
|
||||
readonly onDidDestroyWindow = this._onDidDestroyWindow.event;
|
||||
|
||||
private readonly _onDidChangeWindowsCount = this._register(new Emitter<IWindowsCountChangedEvent>());
|
||||
readonly onDidChangeWindowsCount = this._onDidChangeWindowsCount.event;
|
||||
|
||||
+ private readonly _onDidTriggerSystemContextMenu = this._register(new Emitter<{ window: ICodeWindow; x: number; y: number }>());
|
||||
+ readonly onDidTriggerSystemContextMenu = this._onDidTriggerSystemContextMenu.event;
|
||||
+
|
||||
private readonly windowsStateHandler = this._register(new WindowsStateHandler(this, this.stateMainService, this.lifecycleMainService, this.logService, this.configurationService));
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```src/vs/platform/windows/test/electron-main/windowsFinder.test.ts
|
||||
function createTestCodeWindow(options: { lastFocusTime: number; openedFolderUri?: URI; openedWorkspace?: IWorkspaceIdentifier }): ICodeWindow {
|
||||
return new class implements ICodeWindow {
|
||||
onWillLoad: Event<ILoadEvent> = Event.None;
|
||||
onDidSignalReady: Event<void> = Event.None;
|
||||
// <[CURSOR_POSITION]
|
||||
onDidClose: Event<void> = Event.None;
|
||||
onDidDestroy: Event<void> = Event.None;
|
||||
whenClosedOrLoaded: Promise<void> = Promise.resolve();
|
||||
id: number = -1;
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/src/vs/platform/windows/test/electron-main/windowsFinder.test.ts
|
||||
+++ b/src/vs/platform/windows/test/electron-main/windowsFinder.test.ts
|
||||
@@ -7,60 +7,61 @@ import * as assert from 'assert';
|
||||
function createTestCodeWindow(options: { lastFocusTime: number; openedFolderUri?: URI; openedWorkspace?: IWorkspaceIdentifier }): ICodeWindow {
|
||||
return new class implements ICodeWindow {
|
||||
onWillLoad: Event<ILoadEvent> = Event.None;
|
||||
+ onDidTriggerSystemContextMenu: Event<{ x: number; y: number }> = Event.None;
|
||||
onDidSignalReady: Event<void> = Event.None;
|
||||
onDidClose: Event<void> = Event.None;
|
||||
onDidDestroy: Event<void> = Event.None;
|
||||
whenClosedOrLoaded: Promise<void> = Promise.resolve();
|
||||
id: number = -1;
|
||||
```
|
||||
@@ -0,0 +1,56 @@
|
||||
+++
|
||||
repository_url = "https://github.com/microsoft/vscode"
|
||||
revision = "e28a92fc1fbe9de11eca2f8ad19899334bff8525"
|
||||
+++
|
||||
|
||||
This prediction requires the model to see the `IDiffComputationResult` type definition.
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/src/vs/editor/browser/widget/diffEditorWidget.ts
|
||||
+++ b/src/vs/editor/browser/widget/diffEditorWidget.ts
|
||||
@@ -1117,6 +1117,7 @@
|
||||
&& currentModifiedModel === this._modifiedEditor.getModel()
|
||||
) {
|
||||
this._setState(editorBrowser.DiffEditorState.DiffComputed);
|
||||
+ console.log("did quit:")
|
||||
this._diffComputationResult = result;
|
||||
this._updateDecorationsRunner.schedule();
|
||||
this._onDidUpdateDiff.fire();
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```src/vs/editor/browser/widget/diffEditorWidget.ts
|
||||
if (currentToken === this._diffComputationToken
|
||||
&& currentOriginalModel === this._originalEditor.getModel()
|
||||
&& currentModifiedModel === this._modifiedEditor.getModel()
|
||||
) {
|
||||
this._setState(editorBrowser.DiffEditorState.DiffComputed);
|
||||
console.log("did quit:")
|
||||
// ^[CURSOR_POSITION]
|
||||
this._diffComputationResult = result;
|
||||
this._updateDecorationsRunner.schedule();
|
||||
this._onDidUpdateDiff.fire();
|
||||
}
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/src/vs/editor/browser/widget/diffEditorWidget.ts
|
||||
+++ b/src/vs/editor/browser/widget/diffEditorWidget.ts
|
||||
@@ -1115,10 +1115,10 @@
|
||||
if (currentToken === this._diffComputationToken
|
||||
&& currentOriginalModel === this._originalEditor.getModel()
|
||||
&& currentModifiedModel === this._modifiedEditor.getModel()
|
||||
) {
|
||||
this._setState(editorBrowser.DiffEditorState.DiffComputed);
|
||||
- console.log("did quit:")
|
||||
+ console.log("did quit:", result.quitEarly)
|
||||
this._diffComputationResult = result;
|
||||
this._updateDecorationsRunner.schedule();
|
||||
this._onDidUpdateDiff.fire();
|
||||
}
|
||||
```
|
||||
54
crates/edit_prediction_cli/evals/zed--add-eprintln.md
Normal file
54
crates/edit_prediction_cli/evals/zed--add-eprintln.md
Normal file
@@ -0,0 +1,54 @@
|
||||
+++
|
||||
repository_url = "git@github.com:zed-industries/zed"
|
||||
revision = "b7090c9fae7390a82021b994994c0f587744d96c"
|
||||
+++
|
||||
|
||||
This example shows the model's preference for making conservative predictions, and ability to place
|
||||
the cursor within the predicted output.
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/crates/edit_prediction_ui/src/rate_prediction_modal.rs
|
||||
+++ b/crates/edit_prediction_ui/src/rate_prediction_modal.rs
|
||||
@@ -144,7 +144,7 @@
|
||||
fn select_next_edit(&mut self, _: &NextEdit, _: &mut Window, cx: &mut Context<Self>) {
|
||||
+ epr
|
||||
let next_index = self
|
||||
.ep_store
|
||||
.read(cx)
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```crates/edit_prediction_ui/src/rate_prediction_modal.rs
|
||||
fn select_next_edit(&mut self, _: &NextEdit, _: &mut Window, cx: &mut Context<Self>) {
|
||||
epr
|
||||
// ^[CURSOR_POSITION]
|
||||
let next_index = self
|
||||
.ep_store
|
||||
.read(cx)
|
||||
.shown_predictions()
|
||||
.skip(self.selected_index)
|
||||
.enumerate()
|
||||
.skip(1) // Skip straight to the next item
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/crates/edit_prediction_ui/src/rate_prediction_modal.rs
|
||||
+++ b/crates/edit_prediction_ui/src/rate_prediction_modal.rs
|
||||
@@ -144,14 +144,14 @@
|
||||
fn select_next_edit(&mut self, _: &NextEdit, _: &mut Window, cx: &mut Context<Self>) {
|
||||
- epr
|
||||
+ eprintln!("");
|
||||
# ^[CURSOR_POSITION]
|
||||
let next_index = self
|
||||
.ep_store
|
||||
.read(cx)
|
||||
.shown_predictions()
|
||||
.skip(self.selected_index)
|
||||
.enumerate()
|
||||
.skip(1) // Skip straight to the next item
|
||||
```
|
||||
68
crates/edit_prediction_cli/evals/zed--change-match-arm.md
Normal file
68
crates/edit_prediction_cli/evals/zed--change-match-arm.md
Normal file
@@ -0,0 +1,68 @@
|
||||
+++
|
||||
repository_url = "git@github.com:zed-industries/zed"
|
||||
revision = "be5763632dccb33470ca233c36ccd9e5e790e3b2"
|
||||
+++
|
||||
|
||||
This prediction requires the model to see the `project::Event` enum.
|
||||
|
||||
## Edit History
|
||||
|
||||
```diff
|
||||
--- a/crates/edit_prediction/src/edit_prediction.rs
|
||||
+++ b/crates/edit_prediction/src/edit_prediction.rs
|
||||
@@ -1035,7 +1035,7 @@
|
||||
project_state.recent_paths.push_front(path);
|
||||
}
|
||||
}
|
||||
- project::Event::DiagnosticsUpdated { .. } => {
|
||||
+ project::Event::Disk { .. } => {
|
||||
if cx.has_flag::<EditPredictionJumpsFeatureFlag>() {
|
||||
self.refresh_prediction_from_diagnostics(
|
||||
project,
|
||||
```
|
||||
|
||||
## Cursor Position
|
||||
|
||||
```crates/edit_prediction/src/edit_prediction.rs
|
||||
{
|
||||
project_state.recent_paths.remove(ix);
|
||||
}
|
||||
project_state.recent_paths.push_front(path);
|
||||
}
|
||||
}
|
||||
project::Event::Disk { .. } => {
|
||||
// ^[CURSOR_POSITION]
|
||||
if cx.has_flag::<EditPredictionJumpsFeatureFlag>() {
|
||||
self.refresh_prediction_from_diagnostics(
|
||||
project,
|
||||
```
|
||||
|
||||
## Expected Patch
|
||||
|
||||
```diff
|
||||
--- a/crates/edit_prediction/src/edit_prediction.rs
|
||||
+++ b/crates/edit_prediction/src/edit_prediction.rs
|
||||
@@ -1032,10 +1032,10 @@
|
||||
project_state.recent_paths.push_front(path);
|
||||
}
|
||||
}
|
||||
- project::Event::Disk { .. } => {
|
||||
+ project::Event::DiskBasedDiagnosticsFinished { .. } => {
|
||||
if cx.has_flag::<EditPredictionJumpsFeatureFlag>() {
|
||||
self.refresh_prediction_from_diagnostics(
|
||||
project,
|
||||
```
|
||||
|
||||
```diff
|
||||
--- a/crates/edit_prediction/src/edit_prediction.rs
|
||||
+++ b/crates/edit_prediction/src/edit_prediction.rs
|
||||
@@ -1032,10 +1032,10 @@
|
||||
project_state.recent_paths.push_front(path);
|
||||
}
|
||||
}
|
||||
- project::Event::Disk { .. } => {
|
||||
+ project::Event::DiskBasedDiagnosticsStarted { .. } => {
|
||||
if cx.has_flag::<EditPredictionJumpsFeatureFlag>() {
|
||||
self.refresh_prediction_from_diagnostics(
|
||||
project,
|
||||
```
|
||||
Reference in New Issue
Block a user