implements PLN-0133
Intrepid/Prometeu/Studio/pipeline/pr-master Build started...
JaCoCo Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 62.84% (18504/29445)
* Branch Coverage: 53.33% (7215/13528)
* Lines of Code: 29445
* Cyclomatic Complexity: 11850
#### Quality Gates Summary
Output truncated.
Test / Build skipped: 15, passed: 669
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: 62.84% (18504/29445)
* Branch Coverage: 53.33% (7215/13528)
* Lines of Code: 29445
* Cyclomatic Complexity: 11850
#### Quality Gates Summary
Output truncated.
Test / Build skipped: 15, passed: 669
Intrepid/Prometeu/Studio/pipeline/head This commit looks good
Add PBS document symbols as an AST-backed hierarchical outline of the open .pbs file on FrontendLanguageService. Recovered syntax is enough; unnamed InvalidDecl is omitted; barrels, imports, locals, and compile-only frontends stay empty. Advertise documentSymbolProvider with hierarchical DocumentSymbol. Housekeep DSC-0041 with LSN-0070.
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
||||
package p.studio.lsp.messages;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public record BaselineDocumentSymbol(
|
||||
String name,
|
||||
BaselineDocumentSymbolKind kind,
|
||||
String detail,
|
||||
int startLine,
|
||||
int startCharacter,
|
||||
int endLine,
|
||||
int endCharacter,
|
||||
int selectionStartLine,
|
||||
int selectionStartCharacter,
|
||||
int selectionEndLine,
|
||||
int selectionEndCharacter,
|
||||
List<BaselineDocumentSymbol> children) {
|
||||
|
||||
public BaselineDocumentSymbol {
|
||||
name = requireText(name, "name");
|
||||
kind = Objects.requireNonNull(kind, "kind");
|
||||
detail = detail == null ? "" : detail;
|
||||
if (startLine < 0 || startCharacter < 0 || endLine < 0 || endCharacter < 0
|
||||
|| selectionStartLine < 0 || selectionStartCharacter < 0
|
||||
|| selectionEndLine < 0 || selectionEndCharacter < 0) {
|
||||
throw new IllegalArgumentException("document symbol range coordinates must not be negative");
|
||||
}
|
||||
children = children == null ? List.of() : List.copyOf(children);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package p.studio.lsp.messages;
|
||||
|
||||
public enum BaselineDocumentSymbolKind {
|
||||
KEYWORD,
|
||||
LOCAL,
|
||||
PARAMETER,
|
||||
FIELD,
|
||||
FUNCTION,
|
||||
METHOD,
|
||||
CONSTRUCTOR,
|
||||
STRUCT,
|
||||
BUILTIN_TYPE,
|
||||
SERVICE,
|
||||
HOST,
|
||||
CONTRACT,
|
||||
CALLBACK,
|
||||
ENUM,
|
||||
ERROR,
|
||||
GLOBAL,
|
||||
CONST
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package p.studio.lsp.messages;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record BaselineDocumentSymbols(
|
||||
List<BaselineDocumentSymbol> symbols) {
|
||||
|
||||
public BaselineDocumentSymbols {
|
||||
symbols = symbols == null ? List.of() : List.copyOf(symbols);
|
||||
}
|
||||
|
||||
public static BaselineDocumentSymbols empty() {
|
||||
return new BaselineDocumentSymbols(List.of());
|
||||
}
|
||||
}
|
||||
+1
@@ -12,6 +12,7 @@ public record BaselineServerDescription(
|
||||
boolean signatureHelpSupported,
|
||||
boolean definitionSupported,
|
||||
boolean referencesSupported,
|
||||
boolean documentSymbolsSupported,
|
||||
List<String> semanticTokenTypes,
|
||||
List<BaselineSemanticHostProjection> semanticHostProjections,
|
||||
List<BaselineVisualTheme> visualThemes,
|
||||
|
||||
Reference in New Issue
Block a user