Adopt compile-time Lombok for shared and host boilerplate
This commit is contained in:
@@ -14,6 +14,12 @@ java { sourceCompatibility = JavaVersion.VERSION_25; targetCompatibility = JavaV
|
||||
tasks.withType<JavaCompile>().configureEach { options.release.set(25) }
|
||||
val fxPlatform = if (System.getProperty("os.arch") == "aarch64") "mac-aarch64" else "mac"
|
||||
dependencies {
|
||||
// Keep aligned with the Maven parent's compile-time-only processor.
|
||||
val lombok = "org.projectlombok:lombok:1.18.42"
|
||||
compileOnly(lombok)
|
||||
annotationProcessor(lombok)
|
||||
testCompileOnly(lombok)
|
||||
testAnnotationProcessor(lombok)
|
||||
implementation("de.neitzel.fxdesigner:designer-kit-ui:0.1.0-SNAPSHOT")
|
||||
intellijPlatform {
|
||||
local(providers.gradleProperty("ideaHome").orElse(providers.environmentVariable("IDEA_HOME")))
|
||||
|
||||
+2
-4
@@ -10,9 +10,11 @@ import de.neitzel.fxdesigner.host.HostServices.*;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Consumer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/** Current published evidence only; annotators never build or execute target application code. */
|
||||
@Service(Service.Level.PROJECT)
|
||||
@RequiredArgsConstructor
|
||||
public final class DiagnosticAnnotations {
|
||||
record Publication(
|
||||
String owner,
|
||||
@@ -25,10 +27,6 @@ public final class DiagnosticAnnotations {
|
||||
private final Map<String, Publication> owners = new ConcurrentHashMap<>();
|
||||
private final Project project;
|
||||
|
||||
public DiagnosticAnnotations(Project project) {
|
||||
this.project = project;
|
||||
}
|
||||
|
||||
static DiagnosticAnnotations get(Project project) {
|
||||
return project.getService(DiagnosticAnnotations.class);
|
||||
}
|
||||
|
||||
+5
-10
@@ -9,25 +9,20 @@ import de.neitzel.fxdesigner.contracts.DocumentSnapshot;
|
||||
import de.neitzel.fxdesigner.host.HostServices;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/** Publishes only current FXML evidence to the IDE's existing Problems collector. */
|
||||
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
|
||||
final class IntellijDiagnostics
|
||||
implements HostServices.Diagnostics, ProblemsProvider, AutoCloseable {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private final Project project;
|
||||
private final HostServices.Diagnostics output;
|
||||
private final Map<String, List<Problem>> owned = new HashMap<>(); // EDT only
|
||||
private volatile boolean closed;
|
||||
|
||||
IntellijDiagnostics(Project project, HostServices.Diagnostics output) {
|
||||
this.project = project;
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Project getProject() {
|
||||
return project;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void report(HostServices.Diagnostic d) {
|
||||
output.report(d);
|
||||
|
||||
+3
-4
@@ -17,6 +17,8 @@ import java.nio.file.*;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Adapts actual IntelliJ Documents and native commands/history; never creates a competing undo
|
||||
@@ -209,15 +211,12 @@ public final class IntellijDocuments implements HostServices.Documents, AutoClos
|
||||
FileDocumentManager.getInstance().isDocumentUnsaved(s.document));
|
||||
}
|
||||
|
||||
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
|
||||
private final class Handle implements DocumentSession {
|
||||
private final State s;
|
||||
private boolean released;
|
||||
private Editor editor;
|
||||
|
||||
Handle(State s) {
|
||||
this.s = s;
|
||||
}
|
||||
|
||||
private <T> CompletionStage<T> run(Callable<T> action) {
|
||||
return edt(
|
||||
() -> {
|
||||
|
||||
Reference in New Issue
Block a user