implements PLN-0134
Intrepid/Prometeu/Studio/pipeline/pr-master Build started...
JaCoCo Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 63.37% (18783/29640)
* Branch Coverage: 53.99% (7369/13648)
* Lines of Code: 29640
* Cyclomatic Complexity: 11938
#### Quality Gates Summary
Output truncated.
Test / Build skipped: 15, passed: 674
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.37% (18783/29640)
* Branch Coverage: 53.99% (7369/13648)
* Lines of Code: 29640
* Cyclomatic Complexity: 11938
#### Quality Gates Summary
Output truncated.
Test / Build skipped: 15, passed: 674
Intrepid/Prometeu/Studio/pipeline/head This commit looks good
Add PBS workspace symbols as a physical flatten of the outline named-declaration set on FrontendLanguageService. Regular files only; virtual stdlib, barrels, imports, locals, and compile-only frontends stay empty. Advertise workspaceSymbolProvider with flat SymbolInformation. workspace/symbol does not require an open document. Housekeep DSC-0042 with LSN-0071.
This commit is contained in:
+15
@@ -11,6 +11,11 @@ import java.util.Optional;
|
||||
* Optional frontend-owned editor services.
|
||||
*/
|
||||
public interface FrontendLanguageService {
|
||||
default Optional<FrontendEditorialContext> prepareEditorialContext(
|
||||
final FrontendPhaseContext phaseContext) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
default Optional<FrontendEditorialContext> prepareEditorialContext(
|
||||
final FrontendPhaseContext phaseContext,
|
||||
final FileId fileId) {
|
||||
@@ -95,4 +100,14 @@ public interface FrontendLanguageService {
|
||||
final FrontendEditorialContext editorialContext) {
|
||||
return documentSymbols(request);
|
||||
}
|
||||
|
||||
default List<FrontendWorkspaceSymbol> workspaceSymbols(final FrontendWorkspaceRequest request) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
default List<FrontendWorkspaceSymbol> workspaceSymbols(
|
||||
final FrontendWorkspaceRequest request,
|
||||
final FrontendEditorialContext editorialContext) {
|
||||
return workspaceSymbols(request);
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package p.studio.compiler.services;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.Objects;
|
||||
|
||||
public record FrontendWorkspaceRequest(
|
||||
Path projectRoot,
|
||||
String query) {
|
||||
|
||||
public FrontendWorkspaceRequest {
|
||||
projectRoot = Objects.requireNonNull(projectRoot, "projectRoot").toAbsolutePath().normalize();
|
||||
query = query == null ? "" : query;
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package p.studio.compiler.services;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.Objects;
|
||||
|
||||
public record FrontendWorkspaceSymbol(
|
||||
String name,
|
||||
FrontendSymbolKind kind,
|
||||
String detail,
|
||||
String containerName,
|
||||
Path path,
|
||||
int startOffset,
|
||||
int endOffset) {
|
||||
|
||||
public FrontendWorkspaceSymbol {
|
||||
name = requireText(name, "name");
|
||||
kind = Objects.requireNonNull(kind, "kind");
|
||||
detail = detail == null ? "" : detail.trim();
|
||||
containerName = containerName == null ? "" : containerName.trim();
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user