Skip to content

Commit 28984b1

Browse files
Fix signature formatter for cast tree
1 parent 60f660f commit 28984b1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

scip-semanticdb/src/main/java/com/sourcegraph/scip_semanticdb/SignatureFormatter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ private String formatTree(Tree tree) {
471471
} else if (tree.hasUnaryopTree()) {
472472
return formatUnaryOperation(tree.getUnaryopTree());
473473
} else if (tree.hasCastTree()) {
474-
return "FIX ME";
474+
return "(" + formatType(tree.getCastTree().getTpe()) + ")" + " " + formatTree(tree.getCastTree().getValue());
475475
}
476476

477477
throw new IllegalArgumentException("tree was of unexpected type " + tree);

tests/snapshots/src/main/generated/tests/minimized/src/main/java/minimized/AnnotationParameters.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ interface Foo {
8686
double testCast();
8787
// ^^^^^^^^ definition semanticdb maven . . minimized/Foo#testCast().
8888
// display_name testCast
89-
// signature_documentation java @Bar(FIX ME)\npublic abstract double testCast()
89+
// signature_documentation java @Bar((double) -1)\npublic abstract double testCast()
9090
// kind AbstractMethod
9191
}

0 commit comments

Comments
 (0)