From 4fb1a8e96124553d0f6d1164aa6e205a9d4e626c Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Wed, 2 Sep 2020 16:49:14 +0100 Subject: [PATCH 1/2] Allow double dash for IndexStore-related CLI arguments This is possible thanks to the fix in Argument Parser 0.3.1. --- Sources/sourcekit-lsp/main.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/sourcekit-lsp/main.swift b/Sources/sourcekit-lsp/main.swift index c6f4f0922..8531fbf3a 100644 --- a/Sources/sourcekit-lsp/main.swift +++ b/Sources/sourcekit-lsp/main.swift @@ -103,16 +103,16 @@ struct Main: ParsableCommand { var clangdOptions = [String]() @Option( - name: .customLong("index-store-path", withSingleDash: true), + name: [.long, .customLong("index-store-path", withSingleDash: true)], help: "Override index-store-path from the build system" ) var indexStorePath: AbsolutePath? @Option( - name: .customLong("index-db-path", withSingleDash: true), + name: [.long, .customLong("index-db-path", withSingleDash: true)], help: "Override index-database-path from the build system" ) - var indexDatabasePath: AbsolutePath? + var indexDBPath: AbsolutePath? @Option( help: "Whether to enable server-side filtering in code-completion" @@ -135,7 +135,7 @@ struct Main: ParsableCommand { serverOptions.buildSetup.flags.swiftCompilerFlags = buildFlagsSwift serverOptions.clangdOptions = clangdOptions serverOptions.indexOptions.indexStorePath = indexStorePath - serverOptions.indexOptions.indexDatabasePath = indexDatabasePath + serverOptions.indexOptions.indexDatabasePath = indexDBPath serverOptions.completionOptions.serverSideFiltering = completionServerSideFiltering serverOptions.completionOptions.maxResults = completionMaxResults From 8145889a4cdb212577ee3282dd23abf2cb5fe2bc Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Wed, 2 Sep 2020 16:50:05 +0100 Subject: [PATCH 2/2] Require ArgumentParser 0.3.1 in Package.swift --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 6eb5fdb6b..a88d6cc16 100644 --- a/Package.swift +++ b/Package.swift @@ -232,7 +232,7 @@ if getenv("SWIFTCI_USE_LOCAL_DEPS") == nil { .package(url: "https://github.com/apple/indexstore-db.git", .branch("master")), .package(url: "https://github.com/apple/swift-package-manager.git", .branch("master")), .package(url: "https://github.com/apple/swift-tools-support-core.git", .branch("master")), - .package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "0.3.0")), + .package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "0.3.1")), ] } else { package.dependencies += [