diff --git a/src/server/ast.odin b/src/server/ast.odin index b59aa222..015c6416 100644 --- a/src/server/ast.odin +++ b/src/server/ast.odin @@ -1264,7 +1264,9 @@ build_string_node :: proc(node: ^ast.Node, builder: ^strings.Builder, remove_poi strings.write_string(builder, ": ") build_string(n.value, builder, remove_pointers) case ^ast.Type_Cast: + strings.write_string(builder, "cast(") build_string(n.type, builder, remove_pointers) + strings.write_string(builder, ")") build_string(n.expr, builder, remove_pointers) case ^ast.Bad_Stmt: case ^ast.Bad_Decl: diff --git a/tests/hover_test.odin b/tests/hover_test.odin index 307d0123..f7d18b21 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -6944,3 +6944,15 @@ ast_hover_overload_pointer_arg_from_return :: proc(t: ^testing.T) { test.expect_hover(t, &source, "test.bar :: proc(value: $T) -> T") } + +@(test) +ast_hover_const_with_cast :: proc(t: ^testing.T) { + source: = test.Source { + main = `package test + + F{*}OO :: cast(u8)10 + ` + } + + test.expect_hover(t, &source, "test.FOO :: cast(u8)10") +}