nim-lang / vscode-nim

A VS Code plugin for the Nim language
Other
63 stars 5 forks source link

Question: How should I tell the extension that my project uses the Javascript backend? #50

Closed aboisvert closed 3 months ago

aboisvert commented 3 months ago

I have a JS project that I'd like to develop using the vscode-nim extension.

When I load the project, I get numerous errors when I import karax modules such as,

[{
    "resource": "/home/boisvert/.choosenim/toolchains/nim-2.0.2/lib/js/dom.nim",
    "owner": "nim",
    "severity": 8,
    "message": "This module only works on the JavaScript platform",
    "startLineNumber": 45,
    "startColumn": 10,
    "endLineNumber": 45,
    "endColumn": 10
}]

I tried setting nim.buildCommand' in mysettings.json`:

    "nim.buildCommand": "js",

but that didn't help.

What's the right way to tell the extension that it should use the JS backend when compiling/linting?

jmgomez commented 3 months ago

--backend:js in a config.nims in the root of your project