Factors the cursor_info requests into a single API to asynchronously
make the sourcekitd cursor_info request and wrap the result for easier
consumption from Swift (but not other processing).
Also, cleanup the now unused extensions on Hover that were superceded by
symbolInfo.
Replaces the Hover request extension that was only provides by Swift
with the new symbolInfo LSP extension that clangd also support. This
enables jump-to-defintion an find-references for C/C++/ObjC by using
clangd to find the symbol and then performing an index query to find the
defintion.
rdar://46436917
Clangd provides a symbolInfo request as an extension to LSP that is
equivalent to sourcekitd's cursor info. For now, just add the new types
and add plumb the request through so we can test it in isolation. In a
future commit this will be used to power jump-to-definition.
This rewrites most of the functions for scanning for toolchains to be
single-purpose and factors the configuration (e.g. specific directories
and environment variable names) to only the highest level API. Clients
can now generally use the shared toolchain registry and ignore all the
scanning logic. Incidentally switches to keeping toolchains in order of
registration to avoid non-determinism.
Rework LineTable. Now that line table is just a collection of `Substring`.
Derive UTF16/UTF8 offset from corresponding view of the content String.
Added several methods to translate between line/UTF(8|16)column and
UTF8 offset.
Resolves: https://bugs.swift.org/browse/SR-9311
We have multiple copies of llvm symbols (indexstoredb, indexstore,
llbuild via swiftpm, and sourcekitd), so it's important to keep them
isolated. In practice this seems to have started breaking after we
updated swiftpm and llbuild was added, but it was already a potential
issue before that. The most egregious issue is if you build sourcekit
with assertions, it enables ABI-breaking checks in llvm. On macOS this
dlopen behaviour is already the default.