Commit Graph

21 Commits

Author SHA1 Message Date
Ben Langmuir
cf69c3f76c [test] Stop matching error description text that is not from our code
The underlying JSON parsing error is from Foundation, so we don't want
to try to compare that in our tests. As a quick fix, just compare a
prefix of the string that we control.
2021-03-02 14:00:13 -08:00
Joe Heck
c58d6939cc convert tests from #file to using #filePath 2020-10-31 18:29:08 -07:00
Sebastian Fichtner
7a36a51014 Synchronously send error response on message decoding failure (#334)
* Replaces two logs since those don't result in response messages anymore
* Adds a func for sending messages synchronously, to get the two messages out before fatalError
2020-10-16 16:29:46 -07:00
David Goldman
8b57352f3b Send didSave notifications to clangd if it supports it (#280)
* Send `didSave` notifications to clangd if it supports it

- Minor update to the LSP protocol for `didSave` and `colorProvider` to be more in line with the spec
- Only send color requests over to clangd if it supports it

Rationale for this change: clangd recently implemented didSave support,
it is used to rebuild preambles when the user edits a header file
referenced by an open file.

Change-Id: Ie6e2198bdeccb9d1b4083806c254475baadc2d2b
2020-06-03 14:20:38 -07:00
Alex Hoppen
e2d7eedef8 Unify the naming of request and notification types
Request types should always have the suffix Request and notifications
should end with Notification.

Also moved all request and notification types into separate folders to
reduce the number of files in the LanguageServerProtocol folder.
2019-12-13 13:56:10 -08:00
Alex Hoppen
c3e70b5933 Update ServerCapabilities to match version 3.14 of the LSP spec 2019-12-12 17:17:35 -08:00
Alex Hoppen
5c839f8640 Add support for non-URL URIs
According to the LSP specification, arbitrary URIs can be used as
document identifiers. Instead of internally assuming that all URIs are
URLs, use a DocumentURI enum to represent URIs. These can either be file
URLs or other URIs whose value as treated as an opaque string.
2019-11-20 09:41:48 -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
Richard Howell
81c50db7e1 add the workspace/buildTargets request 2019-09-25 14:16:30 -07:00
Richard Howell
93982b2f2a messageRegistry -> protocol 2019-08-16 19:18:29 -07:00
Richard Howell
481284be31 fix tests 2019-08-15 15:28:21 -07:00
Ben Langmuir
65b98b383c Remove testable imports of LanguageServerProtocolJSONRPC 2019-08-08 22:22:50 -07:00
Ben Langmuir
119b3fa1cb Rename Message -> JSONRPCMessage in preparation for making it public 2019-08-08 22:06:07 -07:00
cukr
719bed2be0 Response to code review 2019-08-08 23:00:03 +02:00
cukr
7b6197394f Merge remote-tracking branch 'upstream/master' into implementation
# Conflicts:
#	Sources/LanguageServerProtocol/ServerCapabilities.swift
#	Sources/SourceKit/SourceKitServer.swift
#	Tests/LanguageServerProtocolJSONRPCTests/CodingTests.swift
2019-08-07 10:48:30 +02:00
cukr
7667608eef Implement "textDocument/implementation" request 2019-07-24 14:42:10 +02:00
Benjamin Kindle
223d11df92 Add workspace/symbols support
https://bugs.swift.org/browse/SR-10806
2019-07-20 08:36:32 -04:00
Bruno Rocha
5406e861b0 Add codeActions API 2019-06-19 21:57:58 -03:00
Bruno Rocha
3f58e09dcf Add folding range requests
Add remaining foldingRange protocol capabilities

Sending offset data to folding requests

FoldingRange test

Support folding comments

Add test for folded comments
2018-12-08 16:07:54 -02:00
Ben Langmuir
13095fab99 [test] Remove defunct static var allTests everywhere
When we started managing the Linux test lists with the
`--generate-linuxmain` option to swiftpm, these all became dead code.
2018-12-06 09:58:35 -08:00
Ben Langmuir
aabf57a252 Import SourceKit-LSP sources 2018-11-13 15:50:48 -08:00