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:
+24
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
+18
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
@@ -20,6 +20,7 @@ public record BaselineServerDescription(
|
||||
boolean foldingRangesSupported,
|
||||
boolean selectionRangesSupported,
|
||||
boolean formattingSupported,
|
||||
boolean callHierarchySupported,
|
||||
List<String> semanticTokenTypes,
|
||||
List<BaselineSemanticHostProjection> semanticHostProjections,
|
||||
List<BaselineVisualTheme> visualThemes,
|
||||
|
||||
Reference in New Issue
Block a user