ols icon indicating copy to clipboard operation
ols copied to clipboard

Autocomplete doesn't always work after dot or arrow been typed in

Open yay opened this issue 1 year ago • 1 comments

In the following example autocomplete doesn't seem to be working on . and -> for the lines highlighted:

package main

import NS "vendor:darwin/Foundation"

@(require)
foreign import "system:Cocoa.framework"

main :: proc() {
    NS.scoped_autoreleasepool()

    app := NS.Application.sharedApplication() // <--- `NS.Application.`
    app->setActivationPolicy(.Regular)

    window := NS.Window.alloc()->initWithContentRect( // <--- `NS.Window.alloc()->`
        {{0, 0}, {500, 400}},
        {.Titled, .Closable, .Resizable},
        .Buffered,
        false,
    )
    window_title := NS.String.alloc()->initWithOdinString("Cocoa window") // <--- `NS.String.alloc()->`
    window->setTitle(window_title)
    window->makeKeyAndOrderFront(nil)

    app->activate()

    app->run()
}

Both issues seem to be Objective C interop related.

Testing with ols built from the https://github.com/DanielGavin/ols/tree/objc-fixes branch.

yay avatar Apr 06 '24 18:04 yay

Update:

Instance method autocomplete (on ->) now works with current version of ols -- list of suggestions pops up after typing NS.Window.alloc()->.

But class method autocomplete still doesn't -- no suggestions after typing NS.Window..

yay avatar Oct 06 '24 19:10 yay