swiftlang/sourcekit-lsp

Add requests to pause and resume indexing

adam-fowler opened this issue · 4 comments

Description

When I run a build in Xcode it pauses indexing is it worthwhile providing support for this in SourceKit-LSP?

Synced to Apple’s issue tracker as rdar://128149559

Unless a compelling use for it comes up, I would prefer to not pause indexing automatically in SourceKit-LSP. Especially with #1260, indexing shouldn’t compete with the running processes for system resources.

I guess as long as it doesn't slowdown or interrupt builds that'll be fine. But at the moment Xcode pauses indexing when building.

Oh, I see, you meant while building, I caught on to the run part of your description.

Xcode has index while building, so a build does index your project as well, so it doesn’t make sense to run a background index simultaneously. In SourceKit-LSP, you currently either purely use index-while-building (status quo) or background indexing (what I’ve been implementing recently) and there’s no way to merge the two. The exact details of how to achieve that (and if we want to at all) are still TBD (#1270 has some of the challenges) and until we do that, there’s no reason to pause indexing during a build.