Commit Graph

33 Commits

Author SHA1 Message Date
Ben Langmuir
a679d4553d [buildsystem] Standardize call between register and settings query NFC
In preparation for injecting doing more during registration, pass
through the same parameters (add language) so that we can call settings
as necessary.
2020-02-05 21:53:52 -08:00
Ben Langmuir
47d92d89f9 Remove unused toolchain lookup function NFC
We want to be able to lookup the toolchain by file eventually, but it's
currently dead code.
2020-02-05 21:53:52 -08:00
Ben Langmuir
cffced1844 Thread Language through FileBuildSettings NFC
Will make it easier to work with cached settings.
2020-02-05 21:53:52 -08:00
Alex Hoppen
f167126c8d Fix typo: JSONRPCConnection should be spelled with two 'n' 2019-11-29 10:20:02 -08:00
Ben Langmuir
ab4a25d581 [BSP] Use URI instead of URL
Similar to LSP, BSP also uses URI. We were handling this correctly
everywhere except one test that was using a string with no scheme.
2019-11-20 09:41:48 -08:00
Alex Hoppen
558d7fc664 Change backing storage of DocumentURI to URL
URL can in fact store URIs, it just doesn't have a very nice API to
interact with them. As long as we only operate on absoluteString, we
should be fine though. So instead of implementing the logic for
detecting file URLs ourselves, we can just use a URL as storage for
DocumentURI.
2019-11-20 09:41:48 -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
Ben Langmuir
775e198f77 Rename LSPSupport -> LSPLogging to reflect reduced scope
Ideally we can someday migrate this to something more standard such as
swift-log, and make it explicit how to control logging for the JSONRPC
module.
2019-11-19 11:08:31 -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
1fde01efc0 Move LanguageServer to SKCore 2019-11-12 16:58:25 -08:00
Ben Langmuir
2c043e9250 Merge pull request #179 from rmaz/indexdbpath
Set index db path from build server response
2019-10-30 16:10:29 -07:00
Richard Howell
1d7858e023 call delegate on build targets change 2019-10-21 10:39:22 -07:00
Richard Howell
8e0fc462a0 set index db path from server data 2019-10-21 10:38:05 -07:00
Richard Howell
93b9838841 shutdown build server connection on deinit 2019-10-17 09:33:00 -07:00
Richard Howell
26d3fca5dd use LSPResult instead of optionals 2019-10-04 15:14:04 -07:00
Richard Howell
0f6f260701 add interface for fetching output paths 2019-10-04 14:51:26 -07:00
Richard Howell
315070d6f7 add inteface to fetch build target sources 2019-10-04 14:50:46 -07:00
Richard Howell
e3fce37388 use LSPResult instead of optional 2019-10-01 14:33:06 -07:00
Richard Howell
81c50db7e1 add the workspace/buildTargets request 2019-09-25 14:16:30 -07:00
Richard Howell
4804c7c138 add register and unregister requests and handle updates 2019-09-13 15:07:08 -07:00
Richard Howell
f2b5f2c167 add settings request and tests 2019-09-10 10:40:14 -07:00
David Goldman
e5caf44fda Add a BuildSystemDelegate which supports notifications for build settings changes
Introduce a `BuildSystemDelegate` to handle notifications from the build system

* `SourceKitServer` is the main delegate to process these notifications
* Currently limited to changes in `FileBuildSettings`
* Delegate informs the `BuildSystem` of files to watch via `registerChangeWatching(for: URL)` and `unregisterChangeWatching(for: URL)`
* In the future we could have more integration for handling changes in dependencies

Handling changes in `FileBuildSettings`

* `SourceKitServer` sends notifications to the internal LSPs informing them of any opened documents that have changes in their compiler flags
    * For clangd, we send a notification to update the compilation database
    * For SourceKit/sourcekitd we must close and reopen the file to force a new AST with the new compiler flags
2019-09-06 17:44:36 -04:00
Ben Langmuir
6bb0924de4 Update one more Basic -> TSCBasic from recent commit 2019-09-03 08:38:38 -07:00
Richard Howell
83d0e75fec nicer case matching for response data 2019-08-29 16:12:09 -07:00
Richard Howell
8e8bf8abf2 don't block shutting down build server 2019-08-29 16:05:20 -07:00
Richard Howell
301fa20327 add log message for shutdown errors 2019-08-29 10:20:27 -07:00
Richard Howell
cbd33eed6a add support for index store path via metadata 2019-08-29 10:20:27 -07:00
Richard Howell
7b842235be add build server lifecycle notifications 2019-08-29 10:04:18 -07:00
Richard Howell
58a42b08b3 use Language instead of String 2019-08-28 19:43:10 -07:00
Richard Howell
bfb0eb7cf9 don't forget to actually initialize the server 2019-08-28 15:43:49 -07:00
Richard Howell
fd6cdfb603 use Codable, start server as part of init, no log on missing config 2019-08-28 15:35:57 -07:00
Richard Howell
89f62f8229 add copyright headers 2019-08-28 15:15:59 -07:00
Richard Howell
366f7d930d Add initial BuildServerBuildSystem based on BSP 2019-08-27 15:47:40 -07:00