Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nimlsp crashes on files that import both cligen and threadpool modules #86

Open
xkqqkx opened this issue Jul 17, 2021 · 2 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@xkqqkx
Copy link

xkqqkx commented Jul 17, 2021

nimlsp crashes when opening file that imports cligen and threadpool modules. Without threadpool import it works fine. On CentOS 7, nim 1.4.8 and neovim 0.5.0 builtin lsp client.

the message was

nimsuggest instance for project /home/user/tmp stopped with exitcode: 1

Small example to reproduce the issue:

import threadpool
import cligen

proc f1(s: string) =
  echo s

proc f2(s: string) =
  echo s

when isMainModule:
  dispatchMulti([f1], [f2])

@xkqqkx
Copy link
Author

xkqqkx commented Aug 4, 2021

solved by adding project configuration file with --threads:on directive

@PMunch
Copy link
Owner

PMunch commented Aug 4, 2021

Ah yes, for NimLSP to work it needs to be able to build the project. This means that any switches that you pass on compile-time should be put in a configuration file so NimLSP can find them. This should have a better failure mode though, with a better error message, so that it's obvious to the user what they need to do. I'll keep this issue open as a reminder.

@PMunch PMunch added enhancement New feature or request good first issue Good for newcomers labels Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants