Injecting a custom FileSystem into SourceKit?

Hi,

I'm interested in getting SourceKit running in an environment where necessary build files (e.g. source files, the stdlib binaries, other binary dependencies), are not actually on the real local filesystem.

clangd has a mechanism for dealing with this: When you start a ClangdServer, you can specify a custom FileSystemProvider implementation, and then clangd reads all files through that. The implementation can go do whatever it wants to fetch the files.

I wasn't able to find a similar mechanism in SourceKit. Would it make sense to add such a mechanism?

For example, would it make sense to add a "FileSystemProvider" argument to sourcekitd::initialize(), so that anyone can compile a SourceKit with custom file fetching logic by simply modifying the call to sourcekitd::initialize()?

1 Like