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
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:
+34
@@ -0,0 +1,34 @@
|
||||
package p.studio.lsp.messages;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public record BaselineCodeAction(
|
||||
String title,
|
||||
String diagnosticCode,
|
||||
String uri,
|
||||
int startLine,
|
||||
int startCharacter,
|
||||
int endLine,
|
||||
int endCharacter,
|
||||
String newText) {
|
||||
|
||||
public BaselineCodeAction {
|
||||
title = requireText(title, "title");
|
||||
diagnosticCode = requireText(diagnosticCode, "diagnosticCode");
|
||||
uri = requireText(uri, "uri");
|
||||
if (startLine < 0 || startCharacter < 0 || endLine < 0 || endCharacter < 0) {
|
||||
throw new IllegalArgumentException("code action range coordinates must not be negative");
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package p.studio.lsp.messages;
|
||||
|
||||
public record BaselineCodeActionDiagnostic(
|
||||
String code,
|
||||
int startLine,
|
||||
int startCharacter,
|
||||
int endLine,
|
||||
int endCharacter) {
|
||||
|
||||
public BaselineCodeActionDiagnostic {
|
||||
code = code == null ? "" : code.trim();
|
||||
if (startLine < 0 || startCharacter < 0 || endLine < 0 || endCharacter < 0) {
|
||||
throw new IllegalArgumentException("diagnostic range coordinates must not be negative");
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package p.studio.lsp.messages;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record BaselineCodeActions(List<BaselineCodeAction> actions) {
|
||||
public BaselineCodeActions {
|
||||
actions = actions == null ? List.of() : List.copyOf(actions);
|
||||
}
|
||||
|
||||
public static BaselineCodeActions empty() {
|
||||
return new BaselineCodeActions(List.of());
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -9,12 +9,14 @@ public record BaselineDocumentIssue(
|
||||
int endCharacter,
|
||||
BaselineIssueSeverity severity,
|
||||
String source,
|
||||
String message) {
|
||||
String message,
|
||||
String code) {
|
||||
|
||||
public BaselineDocumentIssue {
|
||||
severity = Objects.requireNonNull(severity, "severity");
|
||||
source = requireText(source, "source");
|
||||
message = requireText(message, "message");
|
||||
code = code == null ? "" : code.trim();
|
||||
}
|
||||
|
||||
private static String requireText(
|
||||
|
||||
+1
@@ -15,6 +15,7 @@ public record BaselineServerDescription(
|
||||
boolean documentSymbolsSupported,
|
||||
boolean workspaceSymbolsSupported,
|
||||
boolean renameSupported,
|
||||
boolean codeActionsSupported,
|
||||
List<String> semanticTokenTypes,
|
||||
List<BaselineSemanticHostProjection> semanticHostProjections,
|
||||
List<BaselineVisualTheme> visualThemes,
|
||||
|
||||
Reference in New Issue
Block a user