PM: merge F3 hardening: suspended Phpactor start, ConPTY in a job, completion cancel, syntax proptest
Some checks are pending
ci / ci (macos-15) (push) Waiting to run
ci / ci (ubuntu-24.04) (push) Waiting to run
ci / ci (windows-2025) (push) Waiting to run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-27 17:30:10 +01:00
commit d2c853c42f
17 changed files with 468 additions and 36 deletions

View file

@ -147,6 +147,39 @@ fn completion_sees_the_edit_before_it_and_is_capped() {
assert_eq!(items[0]["label"], "item000");
}
#[test]
fn a_new_completion_cancels_the_one_it_supersedes() {
let (_dir, mut engine) = project(&[("a.php", "<?php\nSLOW")], true);
let id = open(&mut engine, "a.php");
let mut slow = engine
.execute(
"lsp.completion",
json!({"id": id, "position": {"line": 1, "column": 4}}),
)
.unwrap();
let slow = slow.pending.take().unwrap();
engine
.execute(
"buffer.edit",
json!({"id": id, "baseVersion": 1, "edits": [{"from": 6, "to": 10, "insert": ""}]}),
)
.unwrap();
let fresh = ask(
&mut engine,
"lsp.completion",
json!({"id": id, "position": {"line": 1, "column": 0}}),
)
.unwrap();
assert_eq!(fresh["items"].as_array().unwrap().len(), 4);
let started = std::time::Instant::now();
let superseded = engine.resolve(slow.wait()).unwrap().value;
assert!(
started.elapsed() < std::time::Duration::from_secs(5),
"the superseded request was not cancelled"
);
assert_eq!(superseded, json!({"items": [], "incomplete": false}));
}
#[test]
fn hover_and_signature_help() {
let (_dir, mut engine) = project(&[("a.php", "<?php\r\npair(1, 2);\r\n")], true);