saem / vscode-nim

Other
177 stars 23 forks source link

making workspace indexing optional #82

Open RSDuck opened 2 years ago

RSDuck commented 2 years ago

Ok this is going to be as bad, but hear me out.

I'm working on a relatively large project and nimsuggest is really slow (or doesn't work at all). So I started looking into it and found out that on the stdin, the response time was actually ok. So I thought maybe it was a bug with the epc interface to nimsuggest, but then it occured to me, that I'm not actually comparing equals here. Before one gets to actually get suggestions, vscode-nim throws every single file in the project at nimsuggest for indexing. So after disabling that it turns out that the editing experience is actually not bad (though I can imagine that after editing in a lot of files, similar problems occur).

Before I'll throw together a PR I wanted to open this issue to share my results and for discussion.

EDIT: I messed around a bit more and it all works fine, until I open that file where nimsuggest goes into an endless loop hehe.

saem commented 2 years ago

Yeah, there is a background indexing operation that happens, with a bunch of caching. But it's usually nimsuggest that loses the plot. nimsuggest doesn't have a reasonable sentinel strategy iirc and so recovery is... annoying.

The plugin could see if it's taking forever and back off on indexing that file I guess. It's bonkers how much complexity all the unresolved compiler issues breed.