Commit Graph

38 Commits

Author SHA1 Message Date
Ben Langmuir
44f535fb91 [buildsystem] Wire up BuildSystemManager to SourceKitServer
Wires up the build system manager in the server, and all existing tests.
2020-02-05 21:53:52 -08:00
Ben Langmuir
23b2fe66fe [bsm] Thread build system manager through tibs workspace and test it 2020-02-05 21:53:52 -08:00
Ben Langmuir
25e3574bc3 Add MainFilesProvider and MainFilesDelegate for index
Introduce types for looking up and receiving notifications about changes
to main file mappings (e.g. header.h -> foo.cpp) in terms of documents.
For now this is only exercised in the test, but the goal is to use this
to correctly lookup main files for headers during build system queries.
2020-02-05 21:53:52 -08:00
David Goldman
56b2463751 Add sourcekitd test via swift tibs
Change-Id: Ia0f25a4167724c00b941dc082f25df3ce4281d17
2020-01-24 13:48:34 -05: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
f167126c8d Fix typo: JSONRPCConnection should be spelled with two 'n' 2019-11-29 10:20:02 -08:00
Ben Langmuir
6c66f8021c [index] Attempt to save index on shutdown
If the client is well-behaved and sends a shutdown request, we close the
index in order to flush it to disk. This should speed up reopening the
same project when it is already indexed.
2019-11-21 11:56:37 -08:00
Ben Langmuir
8a88e9d5f2 [gardening] Changes per review
* Rename Extensions.swift
* Move import where it is used
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
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
Bruno Rocha
9eb2fe4453 Clean implementation 2019-10-04 12:34:09 -03:00
Bruno Rocha
a84eaaa478 Apply review comments (LSPAnyCodable/Cleaning) 2019-10-03 11:37:24 -03:00
Bruno Rocha
8861ac06c1 Add Local Refactoring 2019-10-03 11:20:41 -03:00
Ben Langmuir
81e46c7c46 [test] Flip the default value of allowUnexpectedNotification
This is/was mostly useful for testing specific notification
interactions. Most new tests shouldn't need it, so remove the
boilerplate.
2019-10-01 22:30:58 -07:00
Ben Langmuir
71a94b0717 Add -Xclangd to allow forwarding options to clangd command-line
And factor the configuration that we thread through to the sourcekit
server.
2019-09-30 14:29:18 -07:00
Ben Langmuir
e1fa70d086 Update SPM -> TSC module name prefixes 2019-09-03 08:29:19 -07:00
Ben Langmuir
6c6b10f18e [test] Enable diagnostics test on Linux
The missing XCTest API was added, so we can now enable the test.
2019-08-27 07:23:25 -07:00
Ben Langmuir
fefd85c26d Merge pull request #144 from rmaz/separateregistries
Pass in MessageRegistry instead of using a singleton
2019-08-19 11:58:08 -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
0a2314836b Fix Linux warning about deprecated Process API 2019-08-09 21:25:05 -07:00
Ben Langmuir
c9e18c19b5 [test] Update implementations test for TestLocation unicode 2019-08-08 17:57:53 -07:00
Ben Langmuir
b61d974e49 [test] Update for TestLocation utf8/16 change 2019-08-08 17:47:25 -07:00
Ben Langmuir
e6adeb08ce [test] Add a test for SwiftPM integration
This goes through the work of building a swiftpm package, loading the
index, and performing requests against sourcekit-lsp using that package.
This gives us a canary test for our swiftpm support to make sure the
whole thing works together. We don't anticipate adding many tests like
this, since they are relatively slow.
2019-08-07 20:24:13 -07:00
Ben Langmuir
3044f7394b Add infrastructure for test projects using Tibs
This builds on the indexer changes to support test projects using the
tibs build system. See the commit message from IndexStoreDB for more
information.

This commit adds a couple of simple tests using test fixtures in the
INPUTS directory. It is a fairly minimal change for using the indexer's
test support code to prove the model works. One missing piece here is
support for mutable sources and updating the index, which is supported
on the IndexStoreDB side, but needs a bit more work here.  This also
doesn't include any tests using swiftpm's build system.
2019-07-22 13:57:04 -07:00
Ben Langmuir
9914ae44e6 [test] Disable another measure method missed previously on Linux
On macOS since there is an override, both `measure` methods funnel
through one entry point, but on other platforms they are not `open`, so
we need to shadow all of them.
2019-02-04 14:33:11 -08:00
Ben Langmuir
7f697fa14a [swiftpm] Update to latest master
* import Utility -> import SPMUtility
* AbsolutePath.asString -> path.description or "\(path)"
2019-02-01 16:47:04 -08:00
Ben Langmuir
80951b9e67 Change configuration build path to be absolute
While specifying the build path relative to something might be a useful
idea in principle, we would need a clearer story for how it is specified
and resolved. When passing a path to a command-line argument, it should
be resolved relative to the CWD, not to the package root by default.
Incidentally, it doesn't really make sense to have a global default,
since different build systems are likely to want different defaults. For
now, simplify this configuration to an optional absolute path (passing a
relative path on the command line will resolve relative to the CWD).
Each build system can interpret `nil` as its preferred default.
2019-02-01 09:05:24 -08:00
Ben Langmuir
76d7a2caf5 Merge pull request #65 from krzyzanowskim/cli-arguments
Command line arguments
2019-01-30 11:55:41 -08:00
Ben Langmuir
e47c7db081 [test] Disable performance metrics unless ENABLE_PERF_TESTS is defined
When running in debug, or in continuous integration that is not setup
for performance testing, default to not collecting performance metrics
to avoid failures due to slow or high-variability tests (default
max_stddev = 10% in xctest). Instead, run the measured block once and
skip the timing code. This has the nice side effect of speeding up test
runs in debug builds.
2019-01-23 16:25:50 -08:00
Marcin Krzyzanowski
6df3545f42 Use BuildSetup in place of Configuration.
Add BuildConfiguration
Cleanup imports
2019-01-15 20:49:38 +01:00
Marcin Krzyzanowski
3aeed54261 No need for @testable 2019-01-11 20:19:43 +01:00
Marcin Krzyzanowski
398ff33b9f SKCore.Configuration reflects a server setup and is passed as a depedency injection deep down. 2019-01-11 19:51:04 +01:00
Abdullah Selek
360f88b6db Use Void over () on SKTestSupport files. 2018-12-08 18:32:12 +00:00
Ben Langmuir
361482f3be [swiftpm] Add some basic tests for swiftpm compiler argument calculation 2018-12-02 19:59:53 -08:00
Ben Langmuir
aabf57a252 Import SourceKit-LSP sources 2018-11-13 15:50:48 -08:00