Files
sourcekit-lsp/Sources/SourceKit/SourceKitServer+Options.swift
Ben Langmuir b97dac9b6f [completion] Add an extension to pass completion options per-request
Conflicts:
	Sources/LanguageServerProtocol/SupportTypes/CodeCompletionOptions.swift
	Sources/SourceKit/CodeCompletionOptions.swift
	Sources/SourceKitLSP/CodeCompletionOptions.swift
2020-10-16 13:09:06 -07:00

42 lines
1.4 KiB
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
import LanguageServerProtocol
import SKCore
extension SourceKitServer {
/// Configuration options for the SourceKitServer.
public struct Options {
/// Additional compiler flags (e.g. `-Xswiftc` for SwiftPM projects) and other build-related
/// configuration.
public var buildSetup: BuildSetup
/// Additional arguments to pass to `clangd` on the command-line.
public var clangdOptions: [String]
/// Additional options for the index.
public var indexOptions: IndexOptions
/// Options for code-completion.
public var completionOptions: CodeCompletionOptions
public init(buildSetup: BuildSetup = .default, clangdOptions: [String] = [], indexOptions: IndexOptions = .init(), completionOptions: CodeCompletionOptions = .init()) {
self.buildSetup = buildSetup
self.clangdOptions = clangdOptions
self.indexOptions = indexOptions
self.completionOptions = completionOptions
}
}
}