From a5832e978b63662902ea34dff12e2e86be4c607d Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Wed, 29 Jul 2020 09:55:02 -0700 Subject: [PATCH] [gardening] Fix copyright headers and formating in modified files --- .../Requests/CompletionRequest.swift | 2 +- .../SupportTypes/CodeCompletionOptions.swift | 6 ++++-- .../LanguageServerProtocol/SupportTypes/Position.swift | 2 +- Sources/SourceKitLSP/SourceKitServer+Options.swift | 9 +++++++-- Sources/SourceKitLSP/SourceKitServer.swift | 7 +++++-- Sources/SourceKitLSP/Swift/SwiftLanguageServer.swift | 7 +++++-- 6 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Sources/LanguageServerProtocol/Requests/CompletionRequest.swift b/Sources/LanguageServerProtocol/Requests/CompletionRequest.swift index dffb414f..c87b00c7 100644 --- a/Sources/LanguageServerProtocol/Requests/CompletionRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/CompletionRequest.swift @@ -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 diff --git a/Sources/LanguageServerProtocol/SupportTypes/CodeCompletionOptions.swift b/Sources/LanguageServerProtocol/SupportTypes/CodeCompletionOptions.swift index 7a2aec9d..f1cd0b6c 100644 --- a/Sources/LanguageServerProtocol/SupportTypes/CodeCompletionOptions.swift +++ b/Sources/LanguageServerProtocol/SupportTypes/CodeCompletionOptions.swift @@ -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. diff --git a/Sources/LanguageServerProtocol/SupportTypes/Position.swift b/Sources/LanguageServerProtocol/SupportTypes/Position.swift index 6a3e7cd2..9afcefc6 100644 --- a/Sources/LanguageServerProtocol/SupportTypes/Position.swift +++ b/Sources/LanguageServerProtocol/SupportTypes/Position.swift @@ -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 diff --git a/Sources/SourceKitLSP/SourceKitServer+Options.swift b/Sources/SourceKitLSP/SourceKitServer+Options.swift index 58cead27..c38f4e59 100644 --- a/Sources/SourceKitLSP/SourceKitServer+Options.swift +++ b/Sources/SourceKitLSP/SourceKitServer+Options.swift @@ -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 diff --git a/Sources/SourceKitLSP/SourceKitServer.swift b/Sources/SourceKitLSP/SourceKitServer.swift index 7baf979c..e268e17a 100644 --- a/Sources/SourceKitLSP/SourceKitServer.swift +++ b/Sources/SourceKitLSP/SourceKitServer.swift @@ -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 diff --git a/Sources/SourceKitLSP/Swift/SwiftLanguageServer.swift b/Sources/SourceKitLSP/Swift/SwiftLanguageServer.swift index 5c6dd244..952f4670 100644 --- a/Sources/SourceKitLSP/Swift/SwiftLanguageServer.swift +++ b/Sources/SourceKitLSP/Swift/SwiftLanguageServer.swift @@ -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(