aboutsummaryrefslogtreecommitdiff
path: root/tests/hover_test.odin
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-07-02 16:06:49 +0200
committerDanielGavin <danielgavin5@hotmail.com>2024-07-02 16:06:49 +0200
commit2ab51698771b550f7a735aa9995d8e6b1bba5723 (patch)
tree416884e6e44802aeb634e137d342b7a066bb2a05 /tests/hover_test.odin
parent0e7d21ee627cf152f8c6e80db20f52a94535ad5e (diff)
Check if the identifier is in the imports before checking anything else.
Diffstat (limited to 'tests/hover_test.odin')
-rw-r--r--tests/hover_test.odin38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 22403a0..dcf3a57 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -185,3 +185,41 @@ ast_hover_on_bitset_variable :: proc(t: ^testing.T) {
test.expect_hover(t, &source, "test.derived_bit_set: bit_set[Foo]")
}
+
+@(test)
+ast_hover_struct_field_selector_completion :: proc(t: ^testing.T) {
+
+ packages := make([dynamic]test.Package, context.temp_allocator)
+
+ append(
+ &packages,
+ test.Package {
+ pkg = "my_package",
+ source = `package my_package
+ My_Struct :: struct {
+ one: int,
+ two: int,
+ three: int,
+ }
+ `,
+ },
+ )
+
+ source := test.Source {
+ main = `package test
+
+ import "my_package"
+ My_Foo :: struct {
+ bar: my_package.My_Stru{*}ct,
+ }
+
+ my_package :: proc() {
+
+ }
+
+ `,
+ packages = packages[:],
+ }
+
+ test.expect_hover(t, &source, "my_package.My_Struct: struct")
+}