aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2026-02-10 21:40:49 +1100
committerGitHub <noreply@github.com>2026-02-10 21:40:49 +1100
commit693394edfb73d9b3151432926a25970e07d8f4ed (patch)
treef125c1b0e6b6f7a699127cc7388289773a9eb23b /tests
parentbdb8de855fe54090a388a25c03ef19f279b13b19 (diff)
parentcb8f89b821b19021d018366c04c5f2f837b9d0d0 (diff)
Merge pull request #1292 from BradLewis/feat/add-docs-to-package-hover
Add documentation to package hover info
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin28
-rw-r--r--tests/hover_test.odin51
2 files changed, 79 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index 56553c3..bf05f6a 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -5500,3 +5500,31 @@ ast_completion_fake_method_proc_group_single_arg_cursor_position :: proc(t: ^tes
// The proc group 'negate' should have cursor AFTER parentheses since no additional args
test.expect_completion_edit_text(t, &source, ".", "negate", "methods.negate(n)$0")
}
+
+@(test)
+ast_completion_package_docs :: proc(t: ^testing.T) {
+ packages := make([dynamic]test.Package, context.temp_allocator)
+
+ append(
+ &packages,
+ test.Package {
+ pkg = "my_package",
+ source = `// Package docs
+ package my_package
+ Foo :: struct{}
+ `,
+ },
+ )
+
+ source := test.Source {
+ main = `package test
+ import "my_package"
+ main :: proc() {
+ my_pack{*}
+ }
+ `,
+ packages = packages[:],
+ }
+
+ test.expect_completion_docs(t, &source, "", {"my_package: package\n---\nPackage docs"})
+}
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 35c2c4f..74cf0d0 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -6105,6 +6105,57 @@ ast_hover_parapoly_overloaded_proc_with_bitfield :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "test.entry: test.Entry(int, SmallHandle)")
}
+
+@(test)
+ast_hover_package_docs :: proc(t: ^testing.T) {
+ packages := make([dynamic]test.Package, context.temp_allocator)
+
+ append(
+ &packages,
+ test.Package {
+ pkg = "my_package",
+ source = `// Package docs
+ package my_package
+ Foo :: struct{}
+ `,
+ },
+ )
+ source := test.Source {
+ main = `package test
+ import "my_package"
+ main :: proc() {
+ foo := my_packa{*}ge.Foo{}
+ }
+ `,
+ packages = packages[:],
+ }
+
+ test.expect_hover(t, &source, "my_package: package\n---\nPackage docs")
+}
+
+@(test)
+ast_hover_import_path_package_docs :: proc(t: ^testing.T) {
+ packages := make([dynamic]test.Package, context.temp_allocator)
+
+ append(
+ &packages,
+ test.Package {
+ pkg = "my_package",
+ source = `// Package docs
+ package my_package
+ `,
+ },
+ )
+ source := test.Source {
+ main = `package test
+ import "my_packa{*}ge"
+ `,
+ packages = packages[:],
+ }
+
+ test.expect_hover(t, &source, "my_package: package\n---\nPackage docs")
+}
+
/*
Waiting for odin fix