languageserver icon indicating copy to clipboard operation
languageserver copied to clipboard

Autocompletion Slow

Open ggruenhagen3 opened this issue 6 months ago • 0 comments

Hi,

I'm using VSCode on a remote machine (a university cluster) and I am experiencing slow autocompletion in the VSCode editor with the R extension. When I type, no autocompletion is suggested, then after pressing Ctrl+Space, I see a message that says "Loading", which it will do for about 20s and then autocomplete works smoothly for a bit (1-2 min), then eventually the same thing happens and I have to reload (maybe after being idle for some number of seconds). I've been reading for hours online trying to see if there's anything from similar issues that might help, but so far they haven't worked. I tried disabling all extensions besides R and changing the R>LSP: Args to "--vanilla and --no-init-file". I have all the suggestion settings enabled and based on the Ctrl+Space behavior it really seems like the problem is that it takes a long time for the suggestions to load. I'm guessing a call is made to load R and I wonder if that's really slow for some reason.

When I look at the logs of languageserver, I see that it's loading a lot of my R packages, which has got to be the reason it takes a long time to load. Maybe it's because it's trying load all the packages listed in my R file (or all R files open in the editor?). That would be okay with me if it was done once automatically the first time a suggestion is attempted. But that's not the behavior I am observing. Is there a way I can achieve this behavior or do you have any advice to reach this goal of having smooth autocompletions?

Thanks, George

ggruenhagen3 avatar May 16 '25 20:05 ggruenhagen3