mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
[gardening] Fix copyright headers and formating in modified files
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user