diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2025-06-27 21:48:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-27 21:48:40 +0200 |
| commit | 4eae668a145df223c6cfc7b8929cdd49d436756d (patch) | |
| tree | 107fb0d242639754162e1028e61d18f8dc6bb782 /tests | |
| parent | 863ad953c7ce368c001e15339a0785e1aca0bdc5 (diff) | |
| parent | 9bbb4b4450b5310a68aa4497a3125674452037d7 (diff) | |
Merge pull request #678 from BradLewis/feat/proc-hover-comments
Add proc comments to hover information
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/hover_test.odin | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin index ac741ad..15c76ff 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -1453,6 +1453,57 @@ ast_hover_struct_documentation_using_package :: proc(t: ^testing.T) { test.expect_hover(t, &source, "test.Foo: struct {\n\tusing outer: my_package.Outer,\n\n\t// from `using outer: my_package.Outer`\n\t// Inner doc\n\tusing inner: Inner,\n\n\t// from `using inner: Inner`\n\tusing ii: InnerInner, // InnerInner comment\n\n\t// from `using ii: InnerInner`\n\tfield: int,\n}") } +@(test) +ast_hover_proc_comments :: proc(t: ^testing.T) { + source := test.Source { + main = `package main + import "my_package" + + // doc + foo :: proc() { // do foo + + } + + main :: proc() { + fo{*}o() + } + `, + } + + test.expect_hover(t, &source, "// do foo\ntest.foo: proc()\n doc") +} + +@(test) +ast_hover_proc_comments_package :: proc(t: ^testing.T) { + packages := make([dynamic]test.Package, context.temp_allocator) + + append( + &packages, + test.Package { + pkg = "my_package", + source = `package my_package + + foo :: proc() { // do foo + + } + + `, + }, + ) + source := test.Source { + main = `package main + import "my_package" + + main :: proc() { + my_package.fo{*}o() + } + `, + packages = packages[:], + } + + test.expect_hover(t, &source, "// do foo\nmy_package.foo: proc()") +} + /* Waiting for odin fix |