implements PLN-0137 (7/7) call-hierarchy

Call hierarchy walks CallExpr nodes for functions and methods. It does
not use the references index. A cursor that is not on a callable is
empty, and type hierarchy stays unadvertised.

Housekeep DSC-0066 with LSN-0074.
This commit is contained in:
2026-09-22 09:20:28 +01:00
parent e456bb8d7a
commit 1fcecdb04d
24 changed files with 995 additions and 333 deletions
@@ -0,0 +1,24 @@
package p.studio.lsp.messages;
import java.util.Objects;
public record BaselineCallHierarchyItem(
String name,
boolean method,
String uri,
int startLine,
int startCharacter,
int endLine,
int endCharacter) {
public BaselineCallHierarchyItem {
name = Objects.requireNonNull(name, "name").trim();
uri = Objects.requireNonNull(uri, "uri").trim();
if (name.isEmpty() || uri.isEmpty()) {
throw new IllegalArgumentException("call hierarchy item identity must not be blank");
}
if (startLine < 0 || startCharacter < 0 || endLine < 0 || endCharacter < 0) {
throw new IllegalArgumentException("call hierarchy range coordinates must not be negative");
}
}
}
@@ -0,0 +1,18 @@
package p.studio.lsp.messages;
import java.util.Objects;
public record BaselineCallSite(
BaselineCallHierarchyItem item,
int startLine,
int startCharacter,
int endLine,
int endCharacter) {
public BaselineCallSite {
item = Objects.requireNonNull(item, "item");
if (startLine < 0 || startCharacter < 0 || endLine < 0 || endCharacter < 0) {
throw new IllegalArgumentException("call site coordinates must not be negative");
}
}
}
@@ -20,6 +20,7 @@ public record BaselineServerDescription(
boolean foldingRangesSupported,
boolean selectionRangesSupported,
boolean formattingSupported,
boolean callHierarchySupported,
List<String> semanticTokenTypes,
List<BaselineSemanticHostProjection> semanticHostProjections,
List<BaselineVisualTheme> visualThemes,