Add `.swift-format` to the repo and format the repo with `swift-format`.
This commit does not add any automation to enforce formatting of sourcekit-lsp in CI. The goal of this commit is to get the majority of source changes out of the way so that the diff of actually enforcing formatting will have fewer changes or conflicts.
* Add LSP types and server stubs for call hierarchy support
* Update CMakeLists.txt for new LSP types
* Call hierarchy misc fixes
* Minor PositionRangeArray fixes to simplify codable conformance
* Add CodingTests for PositionRangeArray and CallHierarchy encoding
Apart from removing unnecessary imports, the following changes were
performed:
- Move CancellationToken from SKSupport to LanguageServerProtocol
- Move CustomCodable to its own module
- CustomCodable belongs in LanguageServerProtocol but moving it there
causes compilation to fail. As a workaround, move it to its own
module
This lets us use the `Range<Position>` without manually converting back
and forth in the majority of cases. See the note on HoverResponse for
the behaviour with Optional that makes us have to provide a custom
Codable implementation in two places that used to be synthesized.
We are tied to using a SwiftPM that matches the toolchain, so upgrade
from 0.3.0 to .branch("master") and add a pins file to manage updating
that dependency.
This was driven by changes that broke loading packages being developed
with newer version of SwiftPM when using the 0.3.0 tag of libSwiftPM.
However, the changes seem to work when going in the other direction, so
using the newer libSwiftPM hasn't caused any known regressions for using
older toolchain versions (not guarantteed and not tested extensively
though).
This fixes using the latest (November 13) toolchain snapshot on macOS.
On Linux there are other issues not specific to LSP.