saem / vscode-nim

Other
177 stars 23 forks source link

local `nimbledeps` folder is not included when linting imports #89

Open gtdrakeley opened 2 years ago

gtdrakeley commented 2 years ago

If you are using nimble with the --localdeps flag to keep dependencies local to a project they are not included when linting the files.

As a result nimble build will function as expected but you will have import errors in any source file using installed dependencies.

gtdrakeley commented 2 years ago

Investigated a bit further and it would probably be sufficient to:

saem commented 2 years ago

Could you achieve the same thing with a cfg file? The extension uses nimsuggest, which is essentially the compiler. If anything Nimble should generate a workable cfg.

Nimble and I aren't friends; I tried to deeply incorporate it in the past. You've got an overall approach, if you can make a clean addition I'll accept the PR. Sorry, I can't even begin to imagine spending any more of my time on that thing.

johanobergman commented 10 months ago

You can add --NimblePath: "./nimbledeps/pkgs" for Nim 1 and --NimblePath: "./nimbledeps/pkgs2" for Nim 2 to nim.cfg. This enables linting for locally installed dependencies.