aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/analysis.odin6
-rw-r--r--tests/hover_test.odin10
2 files changed, 12 insertions, 4 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index c1d0016..7b94167 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -2272,6 +2272,12 @@ resolve_symbol_return :: proc(ast_context: ^AstContext, symbol: Symbol, ok := tr
#partial switch &v in symbol.value {
case SymbolProcedureGroupValue:
if s, ok := resolve_function_overload(ast_context, v.group.derived.(^ast.Proc_Group)^); ok {
+ if s.doc == "" {
+ s.doc = symbol.doc
+ }
+ if s.comment == "" {
+ s.comment = symbol.comment
+ }
s.range = symbol.range
s.uri = symbol.uri
return s, true
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 16bbf69..7cf8057 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -397,7 +397,8 @@ ast_hover_proc_group :: proc(t: ^testing.T) {
add_vec :: proc(a, b: [2]f32) -> [2]f32 {return a + b}
- add :: proc {
+ // docs
+ add :: proc { // comment
add_num,
add_vec,
}
@@ -409,7 +410,7 @@ ast_hover_proc_group :: proc(t: ^testing.T) {
packages = {},
}
- test.expect_hover(t, &source, "test.add: proc(a, b: int) -> int")
+ test.expect_hover(t, &source, "test.add: proc(a, b: int) -> int\n docs\n\n// comment")
}
@(test)
@@ -1069,7 +1070,8 @@ ast_hover_proc_overloading_named_arg_with_selector_expr_with_another_package ::
foo_string :: proc(s: string, x := 1) -> (int, bool) {
return 2, true
}
- foo :: proc {
+ // Docs
+ foo :: proc { // comment
foo_none,
foo_string,
}
@@ -1091,7 +1093,7 @@ ast_hover_proc_overloading_named_arg_with_selector_expr_with_another_package ::
packages = packages[:],
}
- test.expect_hover(t, &source, "my_package.foo: proc(x := 1) -> (_: int, _: bool)")
+ test.expect_hover(t, &source, "my_package.foo: proc(x := 1) -> (_: int, _: bool)\n Docs\n\n// comment")
}
@(test)