test(lsp): smoke-test everyday code intelligence per language with real servers (#1299)

* test(lsp): smoke-test everyday code intelligence per language with real servers

A new ide-host integration test drives completion, go to definition, Find
Usages, hover, diagnostics with a quick fix, an intention, formatting and
rename on each language's fixtures/ project, through the ops the app's
commands call and the language server the app starts by default:
TypeScript (vtsls), Python (basedpyright + Ruff), Rust (rust-analyzer),
Go (gopls), Java (jdtls) and Kotlin (kotlin-lsp). A failure names the
language and the operation.

The tests are ignored by default; a Language smoke workflow installs pinned
server versions and runs one language per job on changes to crates/,
languages/ and fixtures/. Adds fixtures/java-app (Maven, JDK 21) for Java.

* test(lsp): rename TypeScript from a usage and check Rust errors while typing

Covers the fixes the smoke test turned up: a TypeScript rename started at a
call site in another file renames the declaration (#1301), and rust-analyzer's
own diagnostics and fixes arrive without saving (#1306).
This commit is contained in:
l0ng-ai
2026-11-04 23:35:53 +08:00
committed by GitHub
parent 1789dbb98e
commit 1e4eee27c4
10 changed files with 963 additions and 0 deletions
@@ -0,0 +1,29 @@
package com.example.orders;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
class OrderBookTest {
@Test
void sumsRevenueOverAllOrders() {
OrderBook book = new OrderBook();
book.place("alice", "Keyboard", 2, 1000);
book.place("bob", "Mouse", 1, 500);
assertEquals(2500, book.revenueCents());
assertEquals(1, book.byCustomer("bob").size());
}
@Test
void rejectsEmptyOrders() {
assertThrows(IllegalArgumentException.class, () -> new Order("alice", "Keyboard", 0, 1000));
}
@Test
@EnabledIfSystemProperty(named = "openidea.fail", matches = "true")
void intentionallyFails() {
assertEquals(1, new OrderBook().size(), "QA: an intentionally failing test");
}
}