aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-10-03 23:34:20 +0200
committerDanielGavin <danielgavin5@hotmail.com>2024-10-03 23:34:20 +0200
commit57a37215651cc18f75bd7421787fa34f8d7278e2 (patch)
tree10f0e424e035af4cdec5a89381e2ac49ab64da15 /tests
parentd6fd27fd0f73ef41193b3a1d3751ba756d199cb1 (diff)
Fix issues with package name and variable name clash
Diffstat (limited to 'tests')
-rw-r--r--tests/hover_test.odin25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index e4b75ee..0afe930 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -305,6 +305,31 @@ ast_hover_struct_field_selector_completion :: proc(t: ^testing.T) {
test.expect_hover(t, &source, "my_package.My_Struct: struct")
}
+@(test)
+ast_hover_package_with_value_decl_same_name :: proc(t: ^testing.T) {
+
+ packages := make([dynamic]test.Package, context.temp_allocator)
+
+ append(
+ &packages,
+ test.Package{pkg = "my_package", source = `package my_package
+ my_package :: proc() -> int {}
+ `},
+ )
+
+ source := test.Source {
+ main = `package test
+ import "my_package"
+ main :: proc() {
+ _ = my_package.my_pack{*}age()
+ }
+ `,
+ packages = packages[:],
+ }
+
+ test.expect_hover(t, &source, "my_package.my_package: proc() -> int")
+}
+
/*
Issue in `core:odin/parser` it sets the wrong column and end offset for line 2.