Commit Graph

19 Commits

Author SHA1 Message Date
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
Alex Hoppen
4b3c571db6 Eliminate _IndirectConnection and replace it by closure
This allows us to move the semaphore logic out of the message to the connection where it belongs.
2019-11-12 15:04:44 -08:00
Ben Langmuir
3a99dddb98 Fix hang/crash when a write failure occurs
This code was doing a sync dispatch to a queue it was already running
on. Instead, go through the same path as other close calls.  This would
hang, or if you're lucky crash when dispatch detects the issue.
2019-10-17 16:51:34 -07:00
Ben Langmuir
cac8f8d77f [tsan] Fix race on close in JSONRPCConnection 2019-10-10 14:05:49 -07:00
Richard Howell
81c50db7e1 add the workspace/buildTargets request 2019-09-25 14:16:30 -07:00
Ben Langmuir
a5d5d09695 [jsonrpc] Fix race between close() and EOF
We implicitly close the connection when the input file descriptor is
closed, or if it has an error. But we also close things down explicitly
when we see the exit notification. We need to protect against a race
triggering us to call the close handler multiple times. This was
resulting in `sourcekit-lsp` racing to call `exit(0)`, which triggered a
double-free and abort on Linux.
2019-08-23 14:03:47 -07:00
Ben Langmuir
e6fc0f017b [cli] Add --sync option for testing
When testing the sourcekit-lsp binary, it is handy to be able to force
requests to be handled synchronously. This only affects the protocol
layer, not the implementation. This option is hidden from the help text
and should only be used for testing/debugging.
2019-08-22 16:19:36 -07:00
Richard Howell
93982b2f2a messageRegistry -> protocol 2019-08-16 19:18:29 -07:00
Richard Howell
3701f6dcd5 pass in message registry instead of singleton 2019-08-15 15:28:19 -07: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
119b3fa1cb Rename Message -> JSONRPCMessage in preparation for making it public 2019-08-08 22:06:07 -07:00
Ben Langmuir
40c57c829f Bump swift-tools-version to 5.1
Changes in swiftpm require swift-5.1, so bump our swift-tools-version to
make it explicit. And fix a new deprecation warning.
2019-07-08 07:07:30 -07:00
Abdullah Selek
fcc91d6e84 Add logs on JSONRPCConnection. 2018-12-10 22:02:17 +00:00
Abdullah Selek
e41128e5ff Use Void over () on LanguageServerProtocolJSONRPC. 2018-12-08 18:30:11 +00:00
Joshua Kaplan
e3ade6c50f Use Void over () 2018-12-07 13:29:16 +09: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