SourceKit-LSP file status indicators
Rough proposal/idea to add some indication of file status to SourceKit-LSP. Let me know what you think.
Give the user an idea of what they should expect - is the build system initializing? Does the
build system recognize the file? Is (pre)building still required before full functionality can
- This will increased perceived reliability as long as these statuses are accurate and clear
- SourceKit-LSP can also change behavior based on these states, e.g. potentially hold back
diagnostics if the build system still needs to prebuild.
Make the clangd/sourcekitd loading state clear. This helps isolate build system vs. compiler
issues and lets the user know the compiler is working (even if we can't provide progress estimates)
Limit compiler file status information to AST-based indexing functionality (no index store status).
We can consider expanding this information to include the index store status as well in the future.
Two different status types: build system and compiler (sourcekitd/clangd). While it
might make sense to merge them, I'm leaning towards keeping them distinct to handle the case
where compiler and build system actions are being performed at the same time.
The statuses below are mostly unstructured and rough ideas, I'm not sure how structured we want to
make them just yet. We'll likely want to categorize them a bit so we can decide what icons to use,
see the UI section below.
- Unknown - No response from compiler yet
- Loading/processing file
- (maybe) potentially outdated (requires some structured build system integration) if dependencies need to be rebuilt
Unknown - No response from build system yet
- Build system setting up/processing, build system can provide messages here to note what it's doing
- e.g. SPM package loading, Bazel loading + analysis phase
- Build system does not support the file or an error occurred while processing (can provide message here)
Unknown file Foo.mor
error loading package Foobar
Prebuilding/Resolving generated files
- Build system building generated inputs required for compilation and indexing
- This in particular we might want to make more structured - that will allow us to do things like
holding off diagnostics if we think we will emit false errors due to missing inputs
- e.g. Xcode prebuilding swiftmodules
Since this is outside of the LSP API, we'll have to implement this into editors ourselves. For
VSCode, we can put these indicators in the status bar on a per-file basis. If we can categorize
the above types we can also put icons in here and then show the full message on hover.