Commit Graph

19 Commits

Author SHA1 Message Date
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
8b3cf55022 [swift] Cleanup CursorInfo and Hover requests
Factors the cursor_info requests into a single API to asynchronously
make the sourcekitd cursor_info request and wrap the result for easier
consumption from Swift (but not other processing).

Also, cleanup the now unused extensions on Hover that were superceded by
symbolInfo.
2018-12-07 00:41:45 -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
Ben Langmuir
4b3b7ba768 [swift] Add bestKnownDeclaration location to symbolInfo for Swift
This is useful for local jump to definition. For now, only swift
implements this.
2018-12-06 22:56:23 -08:00
Ben Langmuir
7c82c9b583 [swift] Implement symbolInfo for Swift 2018-12-06 22:38:25 -08:00
josh
22a49414e8 Fix merge conflicts (Toolchain, SwiftPMWorkspace, SwiftLanguageServer) 2018-12-07 13:39:43 +09:00
yhkaplan
3ef53f3f23 Use trailing closure with Kevin's syntax 2018-12-07 13:29:38 +09:00
Joshua Kaplan
06144c9901 Mark unused completion handler properties as _ 2018-12-07 13:29:16 +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
Ben Langmuir
63b9b3dbaf [build-system] Rename BuildSettingsProvider->BuildSystem and fix method name
I intend to fold more things than file-settings into here, so use a more
generic name. Also drop an unnecessary word from the method name.
2018-12-03 22:30:18 -08:00
Ben Langmuir
a7999dd3d1 Merge pull request #27 from benlangmuir/fix-warnings
[build] Fix warnings about Foundation.Process on Linux
2018-12-02 09:55:26 -08:00
Ben Langmuir
7124a0a3a7 [build] Fix warnings about Foundation.Process on Linux
launchPath and launch are deprecated. Use exectuableURL and run() when
available.
2018-12-01 23:07:39 -08:00
Ben Langmuir
acfa8493d8 [core] Refactor ToolchainRegistry scanning and initialization
This rewrites most of the functions for scanning for toolchains to be
single-purpose and factors the configuration (e.g. specific directories
and environment variable names) to only the highest level API. Clients
can now generally use the shared toolchain registry and ignore all the
scanning logic. Incidentally switches to keeping toolchains in order of
registration to avoid non-determinism.
2018-12-01 22:24:20 -08:00
Rintaro Ishizaki
c97a244874 [SKSupport.LineTable] Fix UTF16 offset calculation
Rework LineTable. Now that line table is just a collection of `Substring`.
Derive UTF16/UTF8 offset from corresponding view of the content String.
Added several methods to translate between line/UTF(8|16)column and
UTF8 offset.

Resolves: https://bugs.swift.org/browse/SR-9311
2018-11-21 21:56:06 +09:00
Ben Langmuir
1def01e634 Use RTLD_DEEP_BIND on Linux when opening libsourcekitdInProc
We have multiple copies of llvm symbols (indexstoredb, indexstore,
llbuild via swiftpm, and sourcekitd), so it's important to keep them
isolated. In practice this seems to have started breaking after we
updated swiftpm and llbuild was added, but it was already a potential
issue before that. The most egregious issue is if you build sourcekit
with assertions, it enables ABI-breaking checks in llvm. On macOS this
dlopen behaviour is already the default.
2018-11-16 16:17:40 -08:00
Ben Langmuir
aabf57a252 Import SourceKit-LSP sources 2018-11-13 15:50:48 -08:00