What's the plan for Index?

What's the plan for updating index? I guess there is a plan, if so would you mind sharing any thoughts @akyrtzi ? I'm asking as this is probably the most needed functionality and I'd like to know if it is work-in-progress already on this one, or it's up for discussion.

I assume you mean background indexing ? If you simply build in debug it will update the index.
For background indexing there is no WIP for it. What we have in mind are that there are 3 pieces:

  • Watching the file system for changes to tracked files and scheduling index jobs when they change
  • A scheduler to manage the background indexing jobs. That involves managing priority, the number of concurrent jobs, pausing, etc.
  • The background index job simply invokes the compiler to index the file, using clang -fsyntax-only -index-store-path <...> or swift -index-file <...>

There are things we could improve but that seems like a solid start.

1 Like

Thanks. The background indexing is one thing, and it's definitely missing right now, the other is support for Xcode projects - any plans? I guess it is in the scope of the project, isn't it?

There is no officially supported way to understand Xcode projects outside of Xcode, for example there is nothing like libSwiftPM which the SwiftPM team commits to support as a way of understanding SwiftPM projects. Unless this situation changes, we do not intend to support Xcode projects outside of the Xcode IDE. Xcode itself will change to provide its settings directly to sourcekit-lsp, when used from inside the IDE.

People have devised methods for getting a compilation database out of an Xcode project, you may want to look into these, the compilation database is something we intend to maintain first-class support for.