Commit Graph

53 Commits

Author SHA1 Message Date
Bruno Rocha
8861ac06c1 Add Local Refactoring 2019-10-03 11:20:41 -03: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
Bruno Rocha
20c026c8e2 Cleaning Code 2019-09-24 17:59:38 -03:00
Bruno Rocha
c20fe44c42 Convert CommandArgumentType -> LSPAny references 2019-09-24 17:21:32 -03:00
Bruno Rocha
7180d66e60 Avoid using decoders for retrieving dictionary data 2019-09-24 17:21:32 -03:00
Bruno Rocha
e71965fc7d Inject metadata at commands 2019-09-24 17:21:32 -03:00
Bruno Rocha
cef91670f5 Add ExecuteCommand/ApplyEdit 2019-09-24 17:21:32 -03: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
e1fa70d086 Update SPM -> TSC module name prefixes 2019-09-03 08:29:19 -07:00
Ben Langmuir
d15071bbd9 [test] Add workspace/_pollIndex extension for testing
Expose the index polling mechanism so it can be used in out-of-process
tests.
2019-08-22 15:57:25 -07:00
Ben Langmuir
ff7d8c1930 [test] Add listenToUnitEvents to initialization options
This should be used along with polling to explicitly control when index
data is read in tests that are outside the sourcekit-lsp process.
2019-08-22 14:53:53 -07:00
Ben Langmuir
9ed80c545e [lsp] Remove InitializationOptions type in favour of LSPAny
While we generally want to be type-safe, initialization options is
LSP-server specific, so just use LSPAny so we can pass arbitrary data
through as needed.
2019-08-22 14:27:44 -07:00
Richard Howell
1f57193cf4 add toolchain interface to BuildServer 2019-08-15 11:04:54 -07:00
Ben Langmuir
c0d2ad0eb8 Merge pull request #126 from Trzyipolkostkicukru/implementation
Implement "textDocument/implementation" request
2019-08-08 17:47:04 -07:00
cukr
719bed2be0 Response to code review 2019-08-08 23:00:03 +02:00
Ben Langmuir
57e340488b [clangd] Set correct argv[0] for clangd to fix c++ header search
Clang looks for the C++ standard headers relative to the clang binary
that we provide in the compilation database. So pass through a real path
so that we get the correct headers.
2019-08-07 18:13:22 -07: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
Ben Langmuir
b8e79ccb4b Merge pull request #123 from literalpie/workspace-symbols
Add workspace/symbols support
2019-08-01 14:44:36 -07:00
Ben Langmuir
806e8efae7 Update for latest indexstore-db API 2019-08-01 11:53:23 -07:00
cukr
7667608eef Implement "textDocument/implementation" request 2019-07-24 14:42:10 +02: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
Benjamin Kindle
223d11df92 Add workspace/symbols support
https://bugs.swift.org/browse/SR-10806
2019-07-20 08:36:32 -04:00
Bruno Rocha
a60c50d1db Make CodeAction wrapper types an enum 2019-06-19 22:57:40 -03:00
Bruno Rocha
69b6663005 Add CodeActions/Command (Rework) 2019-06-19 22:00:18 -03:00
Bruno Rocha
5406e861b0 Add codeActions API 2019-06-19 21:57:58 -03:00
cukr
9f9cc9a734 Implement color presentation 2019-05-30 19:36:09 +02:00
Ben Langmuir
36e567395e Merge pull request #98 from Trzyipolkostkicukru/cukr/document-symbol
Implement document symbol request
2019-05-29 17:20:16 -07:00
Gwen Mittertreiner
b84b38774e Get the pid of the current process using Foundation 2019-04-22 14:41:17 -07:00
cukr
eb8ea967ba Implement document symbol request 2019-04-20 22:49:47 +02:00
Gwen Mittertreiner
0868c5fc4b Fixup SourceKit module on Windows 2019-04-18 13:16:30 -07:00
Ben Langmuir
77351820ce Use AbsolutePath.pathString instead of description
Per review feedback; pathString is semantically the string we want,
while description is for creating a human-readable string.
2019-02-01 18:05: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
76d7a2caf5 Merge pull request #65 from krzyzanowskim/cli-arguments
Command line arguments
2019-01-30 11:55:41 -08:00
David Goldman
6c93c92f4d Allow multiple Xcode toolchains in the registry
1) Toolchain ID is no longer unique; XcodeDefault toolchains may be
   registered multiple times as long as their path is different
   (e.g. different Xcode versions). At the moment no other toolchain
   may be duplicated.
2) `BuildSystem` specifies a `Toolchain` directly instead of a
   Toolchain identifier.
3) New methods to access Toolchains in the registry:
   - All toolchain(s) with the given identifier
   - Toolchain (if any) for the given path
2019-01-22 14:12:50 -05:00
Marcin Krzyzanowski
6df3545f42 Use BuildSetup in place of Configuration.
Add BuildConfiguration
Cleanup imports
2019-01-15 20:49:38 +01:00
Marcin Krzyzanowski
736fdcdac4 Lipstick style - self 2019-01-11 20:01:55 +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
Marcin Krzyzanowski
25939e9526 Add command line arguments with a few configuration options. 2019-01-11 00:24:27 +01:00
Abdullah Selek
4f4ac81f3b Remove extra spaces before func. 2018-12-17 21:09:42 +00:00
Ben Langmuir
51d926cffc Merge pull request #24 from rockbruno/foldingRange
Add "textDocument/foldingRanges"
2018-12-13 08:57:31 -08:00
Abdullah Selek
9c6fd98d38 Use Void over () on SourceKit files. 2018-12-08 18:29:13 +00:00
Bruno Rocha
37d14d486d Fold doc comments 2018-12-08 16:07:54 -02: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
dc32473696 Merge pull request #36 from benlangmuir/symbol-info
[sourcekit] Adopt symbolInfo to implement definition and references
2018-12-07 10:04:31 -08:00
Ben Langmuir
f7288278f6 [sourcekit] Adopt symbolInfo to implement definition and references
Replaces the Hover request extension that was only provides by Swift
with the new symbolInfo LSP extension that clangd also support. This
enables jump-to-defintion an find-references for C/C++/ObjC by using
clangd to find the symbol and then performing an index query to find the
defintion.

rdar://46436917
2018-12-06 23:09:15 -08:00
josh
22a49414e8 Fix merge conflicts (Toolchain, SwiftPMWorkspace, SwiftLanguageServer) 2018-12-07 13:39:43 +09:00
Joshua Kaplan
e3ade6c50f Use Void over () 2018-12-07 13:29:16 +09:00
Ben Langmuir
6c1c5d3283 Add textDocument/symbolInfo LSP extension
Clangd provides a symbolInfo request as an extension to LSP that is
equivalent to sourcekitd's cursor info. For now, just add the new types
and add plumb the request through so we can test it in isolation. In a
future commit this will be used to power jump-to-definition.
2018-12-06 20:06:51 -08:00
Ben Langmuir
c17ae6992a [build-system] Rename BuildSettingsProviderList -> BuildSystemList 2018-12-03 23:05:35 -08:00
Ben Langmuir
7f74d4a25f [build-system] Fold ExternalWorkspace into BuildSystem
Simplifies clients to only need to care about one thing, and makes it
easier for BuildSystems to grow new functionality.
2018-12-03 22:54:35 -08:00