дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 19:25:54 +02:00
lombok.config was ignored in Java builds (e.g. lombok.accessors.chain=true produced void setters), and jdt.ls wrote those classes into target/classes, breaking later Maven builds. Root cause: Lombok calls getModuleClassLoader(boolean), which newer Equinox removed; the exception is swallowed, Lombok resolves the wrong source path and finds no lombok.config at all, so every config key falls back to its default. Affects every Java project using lombok.config. Fix: ship Lombok 1.18.48 with the upstream fix projectlombok/lombok#4059 (lombok-1.18.48-openidea.1, embedded in the app, no download) as the jdt.ls agent; the versioned path also resets the jdt.ls workspace so stale output is rebuilt. A user-configured agent still takes precedence. Return to Maven Central once an official release includes the fix (source and checksum in plugins/lombok/README.md). Verified on macOS: 5 clean builds with chained setters, identical output to official 1.18.48 without lombok.config, the app rebuilds already-poisoned target/classes, and Run works. Windows and Linux not run. Fixes #565
29 рядки
1.3 KiB
Rust
29 рядки
1.3 KiB
Rust
//! Versioned app-owned plugin jars, shared by tool detection and language-server launches.
|
|
|
|
use crate::{Method, ToolSpec};
|
|
use std::path::{Path, PathBuf};
|
|
|
|
pub(crate) fn install(root: &Path, spec: &ToolSpec) -> std::io::Result<PathBuf> {
|
|
let Method::Bundled { filename, bytes, .. } = spec.method else { unreachable!("bundled tool") };
|
|
let dir = root.join(spec.name).join("bin");
|
|
// The agent path participates in the JDT LS workspace key: upgrades must
|
|
// discard incremental state compiled with the previous agent.
|
|
let path = dir.join(filename);
|
|
if std::fs::read(&path).is_ok_and(|old| old == bytes) {
|
|
return Ok(path);
|
|
}
|
|
std::fs::create_dir_all(&dir)?;
|
|
let nonce = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap_or_default().as_nanos();
|
|
let temporary = dir.join(format!(".{filename}-{}-{nonce}.tmp", std::process::id()));
|
|
let result = std::fs::write(&temporary, bytes).and_then(|_| std::fs::rename(&temporary, &path));
|
|
if let Err(error) = result {
|
|
let _ = std::fs::remove_file(&temporary);
|
|
// Another window may have installed the same bytes concurrently.
|
|
if !std::fs::read(&path).is_ok_and(|old| old == bytes) {
|
|
tracing::warn!(tool = spec.name, %error, "Bundled plugin unavailable");
|
|
return Err(error);
|
|
}
|
|
}
|
|
Ok(path)
|
|
}
|