saem / vscode-nim

Other
180 stars 23 forks source link

Fix project mapping schema & build issues #127

Open elijahr opened 11 months ago

elijahr commented 11 months ago

I was seeing errors like this in the Nim Language Server output:

DBG Failed to parse the configuration.

Symbol lookup wasn’t working well with the lsp backend.

It's not documented but according to this stack overflow, configuration entries with type array must nest the properties under items.

Additionally, when running nimble vsix I was getting this error:

vscode-nim/src/tools/elrpc.nim(6, 18) Error: cannot open file: nimsuggest/sexp

This is because nimsuggest is not in the nim installation’s lib directory.

These changes explicitly add the nim installation’s root directory to the search path so that nimsuggest can be found when compiling.

On my system, nim dump in the vscode-nim directory gives these paths:

/Users/user/Development/vscode-nim/src
/Users/user/.asdf/installs/nim/1.6.12/lib/pure
/Users/user/.asdf/installs/nim/1.6.12/lib/core
/Users/user/.asdf/installs/nim/1.6.12/lib/arch
/Users/user/.asdf/installs/nim/1.6.12/lib/pure/unidecode
/Users/user/.asdf/installs/nim/1.6.12/lib/js
/Users/user/.asdf/installs/nim/1.6.12/lib/posix
/Users/user/.asdf/installs/nim/1.6.12/lib/windows
/Users/user/.asdf/installs/nim/1.6.12/lib/wrappers/linenoise
/Users/user/.asdf/installs/nim/1.6.12/lib/wrappers
/Users/user/.asdf/installs/nim/1.6.12/lib/impure
/Users/user/.asdf/installs/nim/1.6.12/lib/pure/concurrency
/Users/user/.asdf/installs/nim/1.6.12/lib/pure/collections
/Users/user/.asdf/installs/nim/1.6.12/lib/deprecated/pure
/Users/user/.asdf/installs/nim/1.6.12/lib/deprecated/core
/Users/user/.asdf/installs/nim/1.6.12/lib
/Users/user/.asdf/installs/nim/1.6.12/lib
/Users/user/.asdf/installs/nim/1.6.12/lib

But nimsuggest is located at /Users/user/.asdf/installs/nim/1.6.12/nimsuggest.