дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 01:01:17 +02:00
fix(java): say which build errors kept a module out of jdtls when Run or Debug starts (#5526)
When m2e or Buildship can't configure a module (e.g. a build plugin that doesn't resolve from the mirror), jdtls keeps it out of the Java model and puts the reason on the module's build file. Run and Debug waited 90 s and then said the module was not imported, or reported compile errors with none listed. The launch now reports the errors jdtls put on the build files of the module and its enclosing builds (pom.xml, build.gradle(.kts), settings.gradle(.kts)) without waiting, as ErrorData::JavaBuildProblems. Fixes #5525. Co-authored-by: wildcatDownstairs <[email protected]>
Цей коміт міститься в:
1 джерело
bb850b25d6
коміт
798c88226c
7 files changed
+123
-7
No files matched your search
@@ -250,6 +250,26 @@ it.each([
|
||||
expect(ipc.runStart).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("says which build errors kept a module from being imported", async () => {
|
||||
const problems = ["web/pom.xml: Plugin org.apache.maven.plugins:maven-compiler-plugin:9.9.9 could not be resolved"];
|
||||
ipc.javaResolveLaunch.mockResolvedValueOnce({
|
||||
status: "error",
|
||||
error: {
|
||||
kind: "invalidInput",
|
||||
message: "jdtls: /p/web is not a Java project",
|
||||
data: { type: "javaBuildProblems", problems },
|
||||
},
|
||||
} as never);
|
||||
const session = await startRun({ ...config, module: "web" });
|
||||
expect(session?.status).toBe("failed");
|
||||
const output = runtime(session!.id)!
|
||||
.console.lines.map((line) => line.text)
|
||||
.join("\n");
|
||||
expect(output).toContain(`Java module 'web' could not be imported because its build has errors: ${problems[0]}.`);
|
||||
expect(output).not.toContain("Wait for Java project import");
|
||||
expect(ipc.runStart).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it.each([
|
||||
["unavailable", "jdtls is not installed (Settings › Languages & Frameworks › Language Servers)"],
|
||||
["unavailable", "jdtls exited with code 1: wrong Java version"],
|
||||
|
||||
Reference in new issue
Заблокувати користувача