Auto completion not working in Visual Studio Code

With Visual Studio Code 1.106.0 + extension for Swift 2.14.0 + Swift 6.2.1 on Windows (ARM) I did not get any auto completion but after some time the message:

The SourceKit-LSP server crashed 6 times in the last 3 minutes. See the output for more information. Do you want to restart it again.

Is there currently a problem with any of these versions or what to do about it?

I also see this error quite often in my medium-sized mixed Swift/C/C++ project.

I would be perfectly fine with adding telemetry to the VSCode extension to supply the developers with more insight into the reasons.

Maybe something to bring up during the Swift Extension Community Office Hour?

1 Like

Logs of the crash would be helpful - @roman-bcny has been working to try to get SourceKit-LSP more responsive on Windows and trying to address the CPU utilisation issues, so if there is another issue, he might already have the context to repair this.

Sorry no logs, the message simply referred to the output where there was no useful information.

After installing / restarting agin (partly because of any other topic), it did work, so yes, it would have been good to be to track why it did not work at the other time. Maybe VS Code was too much charged with other actions which made it unstable.

So for the next time: Where are the detailed logs? And I suppose I then just open an issue at the extension repo instead of a forums topic.

Thanks.

I’m not seeing a CPU hogging issue. But as I said, I would be fine with the VSCode extension calling the mothership to provide valuable diagnostic insights.

I think that telemetry might be a more difficult thing to accomplish for the swift.org toolchain releases. However, an alternative to consider would be an auto-reporting functionality to upload logs as an opt-in? Might be a good thing to track in the issues for GitHub - swiftlang/vscode-swift: Visual Studio Code Extension for Swift.

@sspringer when you see this crash again the Swift extension has a Swift: Capture Diagnostics Bundle command which will grab all the extension and LSP logs for you in an archive. Raise an issue against GitHub - swiftlang/vscode-swift: Visual Studio Code Extension for Swift and attach the archive and we can take a look at where the issue may lie.

Does it crash right away or only after working for a while? If only happening after working away for a while, I’ve seen crashes from memory issues which not always but is sometimes fixed by turning off background indexing.

In the case that I faced auto completion had not started to work (and no indexing message) and I was wondering and trying for a while, and then after a while there was the message about the crashes.

Yes, I would use the command and raise an issue on GitHub the next time, thanks.