Using VS Code with Nim or Nim Alt extension, which internally uses nimsuggest may lead into issues when you start to write code related to threads.
Simple listing for example (aaa.nim):
proc main() =
echo $getThreadId()
when isMainModule:
main()
We got issue on line 2 about usage of undeclared identifier getThreadId.
But code is correct, when compiled with --threads:on switch.
As a solution or workaround, we have to notify nimsuggest, that we use threads and we can do so by creating nim script file (https://nim-lang.org/docs/nims.html -> NimScript as a configuration file) like so:
aaa.nims:
--threads:on
After that, VS Code works as expected.
And question to community: is my solution correct? Or this is some kind of workaround? Is there any more correct way of doing so?
Tx.
I have to say, that I'm shocked (in a positive sense) about all of these design decisions and how all of this organized together.
I'm almost crying.