diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-07-27 10:55:18 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-07-27 10:55:18 -0400 |
| commit | bc57cc161d1fee05dae837e4334985dd283a03ba (patch) | |
| tree | 4dbc9928ca074d26cd2a0b52ee1b2f8fe9fb4ff0 /tests | |
| parent | b9587954c99bb2186deeccb1413f0127241db130 (diff) | |
Only override docs for re-exported items if there is new documentation on the when doing the export
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/hover_test.odin | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin index 783d484..06fe3df 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -3042,6 +3042,65 @@ ast_hover_enum_explicit_type :: proc(t: ^testing.T) { } test.expect_hover(t, &source, "test.Foo: .A") } + +@(test) +ast_hover_documentation_reexported :: proc(t: ^testing.T) { + packages := make([dynamic]test.Package, context.temp_allocator) + + append( + &packages, + test.Package { + pkg = "my_package", + source = `package my_package + // Documentation for Foo + Foo :: struct{} + `, + }, + ) + source := test.Source { + main = `package test + import "my_package" + + F{*}oo :: my_package.Foo + `, + packages = packages[:], + } + test.expect_hover( + t, + &source, + "my_package.Foo: struct {}\n Documentation for Foo", + ) +} + +@(test) +ast_hover_override_documentation_reexported :: proc(t: ^testing.T) { + packages := make([dynamic]test.Package, context.temp_allocator) + + append( + &packages, + test.Package { + pkg = "my_package", + source = `package my_package + // Documentation for Foo + Foo :: struct{} + `, + }, + ) + source := test.Source { + main = `package test + import "my_package" + + // New docs for Foo + F{*}oo :: my_package.Foo + `, + packages = packages[:], + } + test.expect_hover( + t, + &source, + "my_package.Foo: struct {}\n New docs for Foo", + ) +} /* Waiting for odin fix |