-
Notifications
You must be signed in to change notification settings - Fork 302
Allow configuring of SourceKit-LSP’s options using configuration files #1524
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
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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,38 @@ | ||
# Configuration File | ||
|
||
`.sourcekit-lsp/config.json` configuration files can be used to modify the behavior of SourceKit-LSP in various ways. The following locations are checked. Settings in later configuration files override settings in earlier configuration files | ||
- `~/.sourcekit-lsp/config.json` | ||
- On macOS: `~/Library/Application Support/org.swift.sourcekit-lsp/config.json` from the various `Library` folders on the system | ||
- If the `XDG_CONFIG_HOME` environment variable is set: `$XDG_CONFIG_HOME/org.swift.sourcekit-lsp/config.json` | ||
- A `.sourcekit-lsp/config.json` file in a workspace’s root | ||
|
||
The structure of the file is currently not guaranteed to be stable. Options may be removed or renamed. | ||
|
||
## Structure | ||
|
||
`config.json` is a JSON file with the following structure. All keys are optional and unknown keys are ignored. | ||
|
||
- `swiftPM`: Dictionary with the following keys, defining options for SwiftPM workspaces | ||
- `configuration: "debug"|"release"`: The configuration to build the project for during background indexing and the configuration whose build folder should be used for Swift modules if background indexing is disabled | ||
- `scratchPath: string`: Build artifacts directory path. If nil, the build system may choose a default value | ||
- `cCompilerFlags: string[]`: Extra arguments passed to the compiler for C files | ||
- `cxxCompilerFlags: string[]`: Extra arguments passed to the compiler for C++ files | ||
- `swiftCompilerFlags: string[]`: Extra arguments passed to the compiler for Swift files | ||
- `linkerFlags: string[]`: Extra arguments passed to the linker | ||
- `compilationDatabase`: Dictionary with the following keys, defining options for workspaces with a compilation database | ||
- `searchPaths: string[]`: Additional paths to search for a compilation database, relative to a workspace root. | ||
- `fallbackBuildSystem`: Dictionary with the following keys, defining options for files that aren't managed by any build system | ||
- `cCompilerFlags: string[]`: Extra arguments passed to the compiler for C files | ||
- `cxxCompilerFlags: string[]`: Extra arguments passed to the compiler for C++ files | ||
- `swiftCompilerFlags: string[]`: Extra arguments passed to the compiler for Swift files | ||
- `clangdOptions: string[]`: Extra command line arguments passed to `clangd` when launching it | ||
- `index`: Dictionary with the following keys, defining options related to indexing | ||
- `indexStorePath: string`: Directory in which a separate compilation stores the index store. By default, inferred from the build system. | ||
- `indexDatabasePath: string`: Directory in which the indexstore-db should be stored. By default, inferred from the build system. | ||
- `indexPrefixMap: [string: string]`: Path remappings for remapping index data for local use. | ||
- `maxCoresPercentageToUseForBackgroundIndexing: double`: A hint indicating how many cores background indexing should use at most (value between 0 and 1). Background indexing is not required to honor this setting | ||
- `updateIndexStoreTimeout: int`: Number of seconds to wait for an update index store task to finish before killing it. | ||
- `defaultWorkspaceType: "buildserver"|"compdb"|"swiftpm"`: Overrides workspace type selection logic. | ||
- `generatedFilesPath: string`: Directory in which generated interfaces and macro expansions should be stored. | ||
- `experimentalFeatures: string[]`: Experimental features to enable | ||
- `swiftPublishDiagnosticsDebounce`: The time that `SwiftLanguageService` should wait after an edit before starting to compute diagnostics and sending a `PublishDiagnosticsNotification`. |
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
31 changes: 0 additions & 31 deletions
31
Sources/LanguageServerProtocol/SupportTypes/SKCompletionOptions.swift
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
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.
There's a doc comment for this parameter above, I guess it should be removed?