Hello experts! I’ve been experiencing some issue with seemingly my sourcekit-lsp kind of resetting its “state” after every little thing I do.
Just as a heads up, this is using 26.0 sdk, using a build server to build it
For example, lets say I had var foo : bar and did a hover over bar (This is inside file A), and that would show something like Loading… for a few sec, and show final class bar after. Lets say I did a go to def on bar here. If I come back immediately to the file A and do a hover over again, I’d expect final class bar to show up relatively quick. However, with my sklsp, I’ve been realizing that’s not really the case here. It will get stuck at loading again. This was weird, and I was wondering if I was somehow resetting the sklsp and its state. Instead of go-to-def, I just added an invalid print statement, didn’t save it or anything, and it took forever for red squiggles to appear + hovering over the symbol resulted in loading… again.
No errors or crashes, although I did notice textDocument/diagnostic take 10 secs from the trace in my logging. I did also notice a sourcekitd_send_request-before for the file I’m working on, but my key.compilerargs list is long… super long (4k + lines)
To summarize:
- Just doing a go-to-def seemed to be causing this “reset”, so I had suspicion that my build server was somehow feeding the flags to sklsp again causing a “reset”
- I ensured that was not the case, so I’m now suspecting that there’s something else that gets sent, but the trace log is too noisy for me to filter out effectively
So my questions are:
- Is this kind of “resetting” slowness expected? (I’d assume not). Is this “refreshing” the normal behavior, even without the presence of my buildsystem doing anything? (My instinct is yes, it is because it needs to refresh diagnostics when a user is working on the project, of course, but just a sanity check)
- If so, what exactly is the request I can look for that is causing this “refresh”?
- Are go-to-defs or hover overs etc not cached at all internally within sklsp?
- What other things can I do to attempt to debug this issue?
Thanks in advance, please lmk if you need any other additional info