I started using VS Code (under Windows 10), since it seems this is what
many/most Nim users do.
I've wrote my first own little module (a fixed-size array, allocated on the
_shared_ heap, for passing data across threads; could not find an existing
nimble package for this), and ran into an issue testing it.
I wrote some test code, to see if my module works. Unfortunately, the compiled
Nim executable program "blocks" until VS Code is closed. Using the "test" task
works. But trying to run the executable from the command-line (for example, if
I want to pass arguments to the it) doesn't.
I guess this is a common issue, but my search returned no answer. Also, I can't
tell if it is a VS-Code problem, or something specific to Nim, sine I haven't
used VS-Code before.
My _settings.json_:
{
"editor.tabSize": 2, "editor.insertSpaces": true, "editor.wordWrap": "off",
"editor.rulers": [ 120 ], "telemetry.enableTelemetry": false,
"files.autoSave":"afterDelay", "files.autoSaveDelay": 30000,
"files.trimTrailingWhitespace": true,
"files.exclude": {
# CANNOT POST; CAUSE FORUM TO PRODUCE AN ERROR MESSAGE!
},
"nim.buildOnSave": true, "nim.buildCommand": "cpp", "nim.lintOnSave": true,
"nim.project": [], "nim.licenseString": "# Copyright 2017 Sebastien Diot.nn",
"C_Cpp.intelliSenseEngine": "Default"
}
My _tasks.json_:
{
// See
[https://go.microsoft.com/fwlink/?LinkId=733558](https://go.microsoft.com/fwlink/?LinkId=733558)
// for the documentation about the tasks.json format "version": "2.0.0",
"tasks": [
{
"taskName": "build", "type": "shell",
"group": {
"kind": "build", "isDefault": true
}, "command": "nim.exe", "args": ["c", "-o:../bin/${fileBasenameNoExtension}",
"\--threads:on", "${fileBasename}"],
"options": {
"cwd": "${workspaceRoot}/src"
},
"presentation": {
"reveal": "never", "panel": "dedicated"
}
},
{
"taskName": "test", "type": "shell",
"group": {
"kind": "test", "isDefault": true
}, "command": "nim.exe", "args": ["c", "-r",
"-o:../bin/${fileBasenameNoExtension}", "\--threads:on", "${fileBasename}"],
"options": {
"cwd": "${workspaceRoot}/src"
},
"presentation": {
"reveal": "always", "panel": "dedicated"
}
}
]
}