implements PLN-0136
Intrepid/Prometeu/Studio/pipeline/pr-master Build started...
JaCoCo Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 63.75% (19407/30442) * Branch Coverage: 54.17% (7740/14289) * Lines of Code: 30442 * Cyclomatic Complexity: 12365 #### Quality Gates Summary Output truncated.
Test / Build skipped: 15, passed: 685
Intrepid/Prometeu/Studio/pipeline/head This commit looks good

Add PBS quick fixes as frontend-owned repairs transported by the LSP.
Duplicate reserved attributes are deleted at the extra span. Interface
InitAllowed attributes with arguments become [InitAllowed]. The server
matches Diagnostic.code plus range, does not parse messages, and returns
an empty list when the capability or the fix is absent.

Housekeep DSC-0044 with LSN-0073.
This commit is contained in:
2026-09-22 07:43:05 +01:00
parent 6f45f4f205
commit ae891262e1
27 changed files with 1182 additions and 70 deletions
@@ -0,0 +1,36 @@
package p.studio.compiler.services;
import java.nio.file.Path;
import java.util.Objects;
public record FrontendCodeAction(
String title,
String diagnosticCode,
Path path,
int startOffset,
int endOffset,
String newText) {
public FrontendCodeAction {
title = requireText(title, "title");
diagnosticCode = requireText(diagnosticCode, "diagnosticCode");
path = Objects.requireNonNull(path, "path").toAbsolutePath().normalize();
if (startOffset < 0) {
throw new IllegalArgumentException("startOffset must not be negative");
}
if (endOffset < startOffset) {
throw new IllegalArgumentException("endOffset must not be before startOffset");
}
newText = Objects.requireNonNull(newText, "newText");
}
private static String requireText(
final String value,
final String field) {
final String candidate = Objects.requireNonNull(value, field).trim();
if (candidate.isEmpty()) {
throw new IllegalArgumentException(field + " must not be blank");
}
return candidate;
}
}
@@ -138,4 +138,18 @@ public interface FrontendLanguageService {
final String newName) {
return rename(request, offset, newName);
}
default boolean codeActionsSupported() {
return false;
}
default List<FrontendCodeAction> codeActions(final FrontendDocumentRequest request) {
return List.of();
}
default List<FrontendCodeAction> codeActions(
final FrontendDocumentRequest request,
final FrontendEditorialContext editorialContext) {
return codeActions(request);
}
}