[gardening] Fix copyright headers and formating in modified files

This commit is contained in:
Ben Langmuir
2020-07-29 09:55:02 -07:00
parent 76df5ec2f6
commit a5832e978b
6 changed files with 23 additions and 10 deletions

View File

@@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Copyright (c) 2014 - 2020 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

View File

@@ -12,10 +12,12 @@
/// Code-completion configuration.
///
/// **(LSP Extension)**: This is used as part of an extension to the code-completion request.
/// **(LSP Extension)**: This is used as part of an extension to the
/// code-completion request.
public struct CodeCompletionOptions: Codable, Hashable {
/// Whether to use server-side filtering or to return all results and let the client handle all filtering.
/// Whether to use server-side filtering or to return all results and let the
/// client handle all filtering.
public var serverSideFiltering: Bool
/// The maximum number of completion results to return, or `nil` for unlimited.

View File

@@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Copyright (c) 2014 - 2020 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

View File

@@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
// Copyright (c) 2014 - 2020 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
@@ -31,7 +31,12 @@ extension SourceKitServer {
/// Options for code-completion.
public var completionOptions: CodeCompletionOptions
public init(buildSetup: BuildSetup = .default, clangdOptions: [String] = [], indexOptions: IndexOptions = .init(), completionOptions: CodeCompletionOptions = .init()) {
public init(
buildSetup: BuildSetup = .default,
clangdOptions: [String] = [],
indexOptions: IndexOptions = .init(),
completionOptions: CodeCompletionOptions = .init())
{
self.buildSetup = buildSetup
self.clangdOptions = clangdOptions
self.indexOptions = indexOptions

View File

@@ -412,7 +412,6 @@ extension SourceKitServer {
if case .bool(let listenToUnitEvents) = options["listenToUnitEvents"] {
indexOptions.listenToUnitEvents = listenToUnitEvents
}
// FIXME: should these move into client capabilities?
if case .dictionary(let completionOptions) = options["completion"] {
if case .bool(let serverSideFiltering) = completionOptions["serverSideFiltering"] {
self.options.completionOptions.serverSideFiltering = serverSideFiltering
@@ -1012,7 +1011,11 @@ public func languageService(
case .swift:
guard let sourcekitd = toolchain.sourcekitd else { return nil }
return try makeLocalSwiftServer(client: client, sourcekitd: sourcekitd, clientCapabilities: workspace.clientCapabilities, options: options)
return try makeLocalSwiftServer(
client: client,
sourcekitd: sourcekitd,
clientCapabilities: workspace.clientCapabilities,
options: options)
default:
return nil

View File

@@ -1093,8 +1093,11 @@ extension DocumentSnapshot {
}
func makeLocalSwiftServer(
client: MessageHandler, sourcekitd: AbsolutePath,
clientCapabilities: ClientCapabilities?, options: SourceKitServer.Options) throws -> ToolchainLanguageServer {
client: MessageHandler,
sourcekitd: AbsolutePath,
clientCapabilities: ClientCapabilities?,
options: SourceKitServer.Options
) throws -> ToolchainLanguageServer {
let connectionToClient = LocalConnection()
let server = try SwiftLanguageServer(