diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-11-30 03:46:53 -0500 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-11-30 03:46:53 -0500 |
| commit | 2ed6299c85a7ba42185edcdb23987fe75747062e (patch) | |
| tree | d3be06cbc82983a26c22841f829134d53e3970e9 /tests | |
| parent | 4e59e6d6e90bedc1aec9711a7b04b415faf19b8d (diff) | |
Propagate docs and comments for aliases defined in other packages
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/hover_test.odin | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin index e5e986f..8a54ad4 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -5804,6 +5804,54 @@ ast_hover_nested_proc_docs_spaces :: proc(t: ^testing.T) { } test.expect_hover(t, &source, "test.foo :: proc()\n\nDocs!\n Docs2\n") } + +@(test) +ast_hover_propagate_docs_alias_in_package :: proc(t: ^testing.T) { + packages := make([dynamic]test.Package, context.temp_allocator) + + append(&packages, test.Package{pkg = "my_package", source = `package my_package + // Docs! + foo :: proc() {} // Comment! + + bar :: foo + `}) + source := test.Source { + main = `package test + import "my_package" + + main :: proc() { + my_package.ba{*}r() + } + `, + packages = packages[:], + } + test.expect_hover(t, &source, "my_package.bar :: proc()\n Docs!\n\n// Comment!") +} + +@(test) +ast_hover_propagate_docs_alias_in_package_override :: proc(t: ^testing.T) { + packages := make([dynamic]test.Package, context.temp_allocator) + + append(&packages, test.Package{pkg = "my_package", source = `package my_package + // Docs! + foo :: proc() {} // Comment! + + // Overridden + bar :: foo + `}) + source := test.Source { + main = `package test + import "my_package" + + main :: proc() { + my_package.ba{*}r() + } + `, + packages = packages[:], + } + test.expect_hover(t, &source, "my_package.bar :: proc()\n Overridden\n\n// Comment!") +} + /* Waiting for odin fix |