aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-04-06 14:36:07 +0200
committerDanielGavin <danielgavin5@hotmail.com>2024-04-06 14:36:07 +0200
commit7ca20296e16ab36c196140e34a47afea0a64b805 (patch)
treef0312a2a103c61d2400b41bfb03ca5ee56ccf758 /tests
parent9652ef501f0085fd5e335427de95482625b2d1ea (diff)
Call expression should always increment the current argument counter, since argument 1 is always the struct type.
Diffstat (limited to 'tests')
-rw-r--r--tests/objc_test.odin48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/objc_test.odin b/tests/objc_test.odin
index af17c0a..f86f331 100644
--- a/tests/objc_test.odin
+++ b/tests/objc_test.odin
@@ -144,3 +144,51 @@ cobj_hover_chained_selector :: proc(t: ^testing.T) {
"Window.initWithContentRect: proc(self: ^Window, contentRect: Rect, styleMask: WindowStyleMask, backing: BackingStoreType, doDefer: BOOL)",
)
}
+
+@(test)
+cobj_hover_chained_selector :: proc(t: ^testing.T) {
+ packages := make([dynamic]test.Package)
+
+ append(
+ &packages,
+ test.Package {
+ pkg = "my_package",
+ source = `package my_package
+ My_Enum :: enum {
+ Regular = 0,
+ Accessory = 1,
+ Prohibited = 2,
+ }
+
+ @(objc_class="NSWindow")
+ Window :: struct { dummy: int}
+
+ @(objc_type=Window, objc_name="alloc", objc_is_class_method=true)
+ Window_alloc :: proc "c" () -> ^Window {
+ }
+ @(objc_type=Window, objc_name="initWithContentRect")
+ Window_initWithContentRect :: proc (self: ^Window, my_enum: My_Enum) -> ^Window {
+ }
+
+ My_Struct :: struct {
+ dummy: int,
+ }
+ `,
+ },
+ )
+
+ source := test.Source {
+ main = `package test
+ import "my_package"
+
+ main :: proc() {
+ window := my_package.Window.alloc()->initWithContentRect(
+ .{*}
+ )
+ }
+ `,
+ packages = packages[:],
+ }
+
+ test.expect_completion_labels(t, &source, ".", {"Accessory"})
+}