First, many thanks to the great tools around Swift!
We're working on an online Swift IDE (https://bananaide.com/) built with SourceKit-LSP + Monaco Editor + monaco-languageclient. Currently an issue we face is that SourceKit-LSP returns too many CompletionItems in some cases, and as a result, a JSON response of a "textDocument/completion" request can be up to 10MB, which makes the web-based IDE extremely slow. Could some suggest some directions to address this performance issue in the short/mid term, to make auto-complete more light-weight for a web IDE?
Note that we already noticed that the Apple team is aware of the perf issue around global completions (as mentioned at Massive CPU usage and can't even do basic code completion), but we wonder if the fix will only focus on local experience (such as using SourceKit-LSP with VSCode), while the CompletionItems blob could still be too big for web apps.
In case it helps, I read the Swift source code a bit and wonder if the issue is related to this FIXME https://github.com/apple/swift/blob/5be1585d371c377a0c0fb761dfbd969257759842/lib/ClangImporter/ClangImporter.cpp#L2792 .
Suggestions on the issue, or any general suggestions on building a Swift online playground would be really appreciated.