Commit Graph

10 Commits

Author SHA1 Message Date
Alex Hoppen
be42621f4c Don’t crash sourcekit-lsp if a known message is missing a field
Previously, we `fatalError`ing when `JSONDecoder` failed to decode a message from the client. Instead of crashing, try recovering from such invalid messages as best as possible. If we know that the state might  have gotten out of sync with the client, show a notification message to the user, asking them to file an issue.

rdar://112991102
2024-04-02 07:50:03 +02:00
Alex Hoppen
d0fc00ce98 Format using swift-format
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.
2023-10-10 13:44:47 -07:00
Ben Langmuir
10ae122f17 Sink Int extension to JSONRPC
This is the only user of this code, and it's not particularly great.
Sink it to reduce dependency surface area.
2019-11-19 10:52:23 -08:00
Ben Langmuir
ec3fd7f940 Sink firstIndex to its only user in JSONRPC
This isn't a particularly good implementation and it only has one user.
Move it down to reduce dependency surface area.
2019-11-19 10:19:09 -08:00
Alex Hoppen
3eafe7851a Make LSPSupport independent of tools-support-core 2019-11-14 15:11:50 -08:00
Alex Hoppen
05ecd26d08 Reorganize the repository into a set of bare LSP modules and SourceKit modules
We will be able to split the LSP modules off later. These LSP modules
will provide the ability to write custom LSP servers and clients in
Swift. The sourcekit-lsp repository will build on top of this new
package to provide an LSP implementation that creates a language server
for Swift and C-based-languages.
2019-11-14 10:35:06 -08:00
Ben Langmuir
65b98b383c Remove testable imports of LanguageServerProtocolJSONRPC 2019-08-08 22:22:50 -07:00
Ben Langmuir
ddd096f019 Rename JSONRPCMessageHeader and methods in preparation for making public 2019-08-08 22:14:57 -07:00
Ben Langmuir
048d72b163 Upgrade SwiftPM dependency to master branch
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.
2018-11-16 15:11:38 -08:00
Ben Langmuir
aabf57a252 Import SourceKit-LSP sources 2018-11-13 15:50:48 -08:00