So, I'm having pretty blocker-level issues with NimSuggest, Jester, and Karax. Before I proceed to report them, I'd like to ask the comminity if that's really how thing roll for everybody now. I'll be happy to know that there's something I'm doing wrong and fix it. So far, I'm clueless. Looks like NimSuggest just dies trying to process macros ¯\_(ツ)_/¯
Using Sublime Text with NimLSP and NimSuggest, I'm getting errors for the most basic Jester and Karax files. NimSuggest chokes on the most basic macros, routes and buildHtml respectively.
Here's the code sample for Jester:
import jester
routes:
get "/":
resp "Hello Jester!"
Here's the code sample for Karax:
include karax/prelude
proc render: VNode =
buildHtml:
text "Hello Karax!"
setRenderer render
Both files yield the same error in Sublime Text, just on different lines:
◌ kar.nim:
5:3 nimsuggest chk hint template/generic instantiation from here
◌ jes.nim:
4:1 nimsuggest chk hint template/generic instantiation from here
Then NimLSP server just crashes.
Running vanilla NimSuggest on the same files returns the same errors on the first run, but on consecutive runs it gives more and more errors, they go deeper and deeper into the packages, then into the stdlib. And then NimSuggest crashes.
nimsuggest crashing/getting hung up in an endless loop are things I experienced myself and read other's have experienced as well.
And checking for errors via nimsuggest is also not that accurate, which is why often nim check is often used for that.
nimsuggest crashing/getting hung up in an endless loop are things I experienced myself and read other's have experienced as well.
Do you know any workaround for that?
And checking for errors via nimsuggest is also not that accurate, which is why often nim check is often used for that.
Huh, didn't know about nim check. Tried running it on my Jester files, no errors pop. Great!
But with Karax files, it's a disaster. Screens and screens of errors.
Also, AFAIU nim check can't be used instead of nimsuggest for on-the-fly code checks like the one performed by nimlsp
nimlsp (even the latest which tries to find the project file) and both vscode extensions (Nim one is slightly better) just plain don't get the whole project setup correct. This means they invoke a nimsuggest process with the wrong project file and/or with missing parameters.
I'm not saying nimsuggest doesn't have a bunch of issues, but I wouldn't at all be surprised if that was at play here. One way to check would be to start a nimsuggest process manually, with the correct project file and ensuring the appropriate cfg/nims are loaded. Then test out some def and use invocations. If some of those work then it'd be far easier to narrow things down.
nimlsp (even the latest which tries to find the project file) and both vscode extensions (Nim one is slightly better) just plain don't get the whole project setup correct.
The VSCode extension allows to set the project file manually. And NimLSP seems to get the project file right in many cases.
I'm getting the same errors with vanilla nimsuggest, so it's not really NimLSP or VSCode issue, its a nimsuggest issue.
Also, I haven't really noticed any difference in nimsuggest behavior if I switch project files.