-
Notifications
You must be signed in to change notification settings - Fork 314
Add documentation about each module's purpose and move some files between modules #1517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
# Modules | ||
|
||
The SourceKit-LSP package contains the following non-testing modules. | ||
|
||
### BuildServerProtocol | ||
|
||
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. | ||
|
||
FIXME: Add link for BSP and version | ||
|
||
### CAtomics | ||
|
||
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. | ||
|
||
### CSKTestSupport | ||
|
||
FIXME: Can we remove this? | ||
|
||
### Csourcekitd | ||
|
||
Header file defining the interface to sourcekitd. This should stay in sync with [sourcekitd.h](TODO) in the Swift repository. | ||
|
||
### Diagnose | ||
|
||
A collection of subcommands to the `sourcekit-lsp` executable that help SourceKit-LSP diagnose issues. | ||
|
||
### InProcessClient | ||
|
||
A simple type that allows launching a SourceKit-LSP server in-process, communicating in terms of structs from the `LanguageServerProtocol` module. | ||
|
||
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. | ||
|
||
### LanguageServerProtocol | ||
|
||
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. | ||
|
||
### LanguageServerProtocolJSONRPC | ||
|
||
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. | ||
|
||
### LSPLogging | ||
|
||
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. | ||
|
||
FIXME: Rename the module to SKLogging | ||
|
||
### LSPTestSupport | ||
|
||
FIXME: Merge this module with SKTestSupport | ||
|
||
### SemanticIndex | ||
|
||
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. | ||
|
||
### SKCore | ||
|
||
FIXME: Currently serves two independent purposes and should be split up into two modules | ||
|
||
#### BuildSystem | ||
|
||
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. | ||
|
||
This includes: | ||
- BuildConfiguration.swift | ||
- BuildServerBuildSystem.swift | ||
- BuildSetup.swift | ||
- BuildSystem.swift | ||
- BuildSystemDelegate.swift | ||
- BuildSystemManager.swift | ||
- CompilationDatabase.swift | ||
- CompilationDatabaseBuildSystem.swift | ||
- FallbackBuildSystem.swift | ||
- FileBuildSettings.swift | ||
- IndexTaskID.swift | ||
- MainFilesProvider.swift | ||
- PathPrefixMapping.swift | ||
- SplitShellCommand.swift | ||
- WorkspaceType.swift | ||
|
||
#### ToolchainRegistry | ||
|
||
Discovers Swift toolchains on the system. | ||
|
||
- Toolchain.swift | ||
- ToolchainRegistry.swift | ||
- XCToolchainPlist.swift | ||
|
||
|
||
### SKSupport | ||
|
||
Contains SourceKit-LSP-specific helper functions. These fall into three different categories: | ||
- Extensions on top of `swift-tools-support-core` | ||
- Functionality that can only be implemented by combining two lower-level modules that don't have a shared dependency, like `LSPLogging` + `LanguageServerProtocol` | ||
- 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`. | ||
|
||
### SKSwiftPMWorkspace | ||
|
||
Implements the `BuildSystem` protocol for Swift packages. | ||
|
||
FIXME: Merge this into the BuildSystem module once SKCore is split. | ||
|
||
### SKTestSupport | ||
|
||
A collection of utilities useful for writing tests for SourceKit-LSP and which are not specific to a single test module. | ||
|
||
### sourcekit-lsp | ||
|
||
This executable target that produces the `sourcekit-lsp` binary. | ||
|
||
### SourceKitD | ||
|
||
A Swift interface to talk to sourcekitd. | ||
|
||
### SourceKitLSP | ||
|
||
This is the core module that implements the SourceKit-LSP server. | ||
|
||
### SwiftExtensions | ||
|
||
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 | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
|
||
add_library(SourceKitD STATIC | ||
dlopen.swift | ||
SKDRequestArray.swift | ||
SKDRequestDictionary.swift | ||
SKDResponse.swift | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the "non-testing" mean here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically the
testTargets
are also modules. But I didn’t include them here because they aren’t really relevant for the modules structure.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see 👍 Not sure why this didn't make me think of
testTarget
.