saem / vscode-nim

Other
177 stars 23 forks source link

extension is not reading .cache/nim/projectname_[r|d] #65

Open arkanoid87 opened 2 years ago

arkanoid87 commented 2 years ago

While experimenting with futhark I've found out that contrary to the javascript based extension, this one doesn't consider the nim files inside the cache

ghost commented 2 years ago

Can you explain this more, perhaps with an example to reproduce?

arkanoid87 commented 2 years ago

Here you can find the nimble project: https://github.com/arkanoid87/nimarrowglib that uses futhark the way it is intended to be used. It creates a futhark.nim file in .cache/nim/[r|d].

Within vscode you won't have any symbols defined in cache. Here is where I think the inclusion of the cache happens.

Attached here is the same project after futhark but without it, with just a quick test on the lib and the nim generated by futhark included. This version get parsed correctly and autocompletion works

include futharkcache

var error: ptr Gerror

var builder = garrow_int32_array_builder_new()

discard garrow_int32_array_builder_append_value(builder, 29, error.addr)
discard garrow_int32_array_builder_append_value(builder, 2929, error.addr)
discard garrow_int32_array_builder_append_value(builder, 292929, error.addr)

var myarray = garrow_array_builder_finish(cast[ptr Garrowarraybuilder](builder), error.addr)
g_object_unref(builder)

var n = garrow_array_get_length(myarray)
echo n

for i in 0..<n:
    var val = garrow_int32_array_get_value(cast[ptr Garrowint32array](myarray), i)
    echo val

g_object_unref(myarray)

nimarrowglib.zip

Both depends on apache arrow-glib dev packages