|
| 1 | +# Modules |
| 2 | + |
| 3 | +The SourceKit-LSP package contains the following non-testing modules. |
| 4 | + |
| 5 | +### BuildServerProtocol |
| 6 | + |
| 7 | +Swift types to represent the [Build Server Protocol (BSP) specification, version TODO](TODO). These types should also be usable when implementing a BSP client and thus this module should not have any dependencies other than the LanguageServerProtocol module, with which it shares some types. |
| 8 | + |
| 9 | +FIXME: Add link for BSP and version |
| 10 | + |
| 11 | +### CAtomics |
| 12 | + |
| 13 | +Implementation of atomics for Swift using C. Once we can raise our deployment target to use the `Atomic` type from the Swift standard library, this module should be removed. |
| 14 | + |
| 15 | +### CSKTestSupport |
| 16 | + |
| 17 | +FIXME: Can we remove this? |
| 18 | + |
| 19 | +### Csourcekitd |
| 20 | + |
| 21 | +Header file defining the interface to sourcekitd. This should stay in sync with [sourcekitd.h](TODO) in the Swift repository. |
| 22 | + |
| 23 | +### Diagnose |
| 24 | + |
| 25 | +A collection of subcommands to the `sourcekit-lsp` executable that help SourceKit-LSP diagnose issues. |
| 26 | + |
| 27 | +### InProcessClient |
| 28 | + |
| 29 | +A simple type that allows launching a SourceKit-LSP server in-process, communicating in terms of structs from the `LanguageServerProtocol` module. |
| 30 | + |
| 31 | +This should be the dedicated entry point for clients that want to run SourceKit-LSP in-process instead of launching a SourceKit-LSP server out-of-process and communicating with it using JSON RPC. |
| 32 | + |
| 33 | +### LanguageServerProtocol |
| 34 | + |
| 35 | +Swift types to represent the [Language Server Protocol (LSP) specification, version 3.17](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/). These types should also be usable when implementing an LSP client and thus this module should not have any dependencies. |
| 36 | + |
| 37 | +### LanguageServerProtocolJSONRPC |
| 38 | + |
| 39 | +A connection to or from a SourceKit-LSP server. Since message parsing can fail, it needs to handle errors in some way and the design decision here is to use LSPLogging, which hardcodes `org.swift.sourcekit-lsp` as the default logging subsystem and thus makes the module unsuitable for generic clients. |
| 40 | + |
| 41 | +### LSPLogging |
| 42 | + |
| 43 | +Types that are API-compatible with OSLog to allow logging to OSLog when building for Darwin platforms and logging to stderr or files on non-Darwin platforms. This should not be dependent on any LSP specific types and be portable to other packages. |
| 44 | + |
| 45 | +FIXME: Rename the module to SKLogging |
| 46 | + |
| 47 | +### LSPTestSupport |
| 48 | + |
| 49 | +FIXME: Merge this module with SKTestSupport |
| 50 | + |
| 51 | +### SemanticIndex |
| 52 | + |
| 53 | +Contains the interface with which SourceKit-LSP queries the semantic index, adding up-to-date checks on top of the indexstore-db API. Also implements the types that manage background indexing. |
| 54 | + |
| 55 | +### SKCore |
| 56 | + |
| 57 | +FIXME: Currently serves two independent purposes and should be split up into two modules |
| 58 | + |
| 59 | +#### BuildSystem |
| 60 | + |
| 61 | +Defines the queries SourceKit-LSP can ask of a a build system, like getting compiler arguments for a file. Finding a target’s dependencies or preparing a target. |
| 62 | + |
| 63 | +This includes: |
| 64 | +- BuildConfiguration.swift |
| 65 | +- BuildServerBuildSystem.swift |
| 66 | +- BuildSetup.swift |
| 67 | +- BuildSystem.swift |
| 68 | +- BuildSystemDelegate.swift |
| 69 | +- BuildSystemManager.swift |
| 70 | +- CompilationDatabase.swift |
| 71 | +- CompilationDatabaseBuildSystem.swift |
| 72 | +- FallbackBuildSystem.swift |
| 73 | +- FileBuildSettings.swift |
| 74 | +- IndexTaskID.swift |
| 75 | +- MainFilesProvider.swift |
| 76 | +- PathPrefixMapping.swift |
| 77 | +- SplitShellCommand.swift |
| 78 | +- WorkspaceType.swift |
| 79 | + |
| 80 | +#### ToolchainRegistry |
| 81 | + |
| 82 | +Discovers Swift toolchains on the system. |
| 83 | + |
| 84 | +- Toolchain.swift |
| 85 | +- ToolchainRegistry.swift |
| 86 | +- XCToolchainPlist.swift |
| 87 | + |
| 88 | + |
| 89 | +### SKSupport |
| 90 | + |
| 91 | +Contains SourceKit-LSP-specific helper functions. These fall into three different categories: |
| 92 | +- Extensions on top of `swift-tools-support-core` |
| 93 | +- Functionality that can only be implemented by combining two lower-level modules that don't have a shared dependency, like `LSPLogging` + `LanguageServerProtocol` |
| 94 | +- Types that should be sharable by the different modules that implement SourceKit-LSP but that are not generic enough to fit into `SwiftExtensions`, like `ExperimentalFeatures`. |
| 95 | + |
| 96 | +### SKSwiftPMWorkspace |
| 97 | + |
| 98 | +Implements the `BuildSystem` protocol for Swift packages. |
| 99 | + |
| 100 | +FIXME: Merge this into the BuildSystem module once SKCore is split. |
| 101 | + |
| 102 | +### SKTestSupport |
| 103 | + |
| 104 | +A collection of utilities useful for writing tests for SourceKit-LSP and which are not specific to a single test module. |
| 105 | + |
| 106 | +### sourcekit-lsp |
| 107 | + |
| 108 | +This executable target that produces the `sourcekit-lsp` binary. |
| 109 | + |
| 110 | +### SourceKitD |
| 111 | + |
| 112 | +A Swift interface to talk to sourcekitd. |
| 113 | + |
| 114 | +### SourceKitLSP |
| 115 | + |
| 116 | +This is the core module that implements the SourceKit-LSP server. |
| 117 | + |
| 118 | +### SwiftExtensions |
| 119 | + |
| 120 | +Extensions to the Swift standard library and Foundation. Should not have any other dependencies. Any types in here should theoretically make senses to put in the Swift standard library or Foundation and they shouldn't be specific to SourceKit-LSP |
| 121 | + |
0 commit comments