DanielGavin / ols

Language server for Odin
MIT License
375 stars 56 forks source link

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

Open yay opened 3 months ago

yay commented 3 months ago

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.