vscode-nim icon indicating copy to clipboard operation
vscode-nim copied to clipboard

making workspace indexing optional

Open RSDuck opened this issue 3 years ago • 1 comments

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.

RSDuck avatar Mar 15 '22 23:03 RSDuck

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.

saem avatar Mar 20 '22 11:03 saem