vscode-nim
vscode-nim copied to clipboard
local `nimbledeps` folder is not included when linting imports
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.
Investigated a bit further and it would probably be sufficient to:
- call
nimble list --installedto get a list of installed packages - for each one execute
nimble path <pkg>to get their path - for each path, add a
--path:<path>option to the call tonim checkor any other tools that need to know the location of installed packages
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.
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.