Skip to content

Commit c006421

Browse files
committed
Switch to more descriptive case names
1 parent 3278ff0 commit c006421

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

Sources/LanguageServerProtocol/SupportTypes/WorkspaceFolder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public enum BuildConfiguration: Hashable, Codable {
2222
///
2323
/// **(LSP Extension)**
2424
public enum WorkspaceType: Hashable, Codable {
25-
case buildserver, compdb, swiftpm
25+
case buildServer, compilationDatabase, swiftPM
2626
}
2727

2828
/// Build settings that should be used for a workspace.

Sources/SKSupport/WorkspaceType.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
public enum WorkspaceType: String {
14-
case buildserver
15-
case compdb
16-
case swiftpm
14+
case buildServer
15+
case compilationDatabase
16+
case swiftPM
1717
}

Sources/SourceKitLSP/SourceKitServer.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -974,13 +974,13 @@ extension LanguageServerProtocol.BuildConfiguration {
974974
}
975975
}
976976

977-
extension LanguageServerProtocol.WorkspaceType {
977+
private extension LanguageServerProtocol.WorkspaceType {
978978
/// Convert `LanguageServerProtocol.WorkspaceType` to `SkSupport.WorkspaceType`.
979979
var workspaceType: SKSupport.WorkspaceType {
980980
switch self {
981-
case .buildserver: return .buildserver
982-
case .compdb: return .compdb
983-
case .swiftpm: return .swiftpm
981+
case .buildServer: return .buildServer
982+
case .compilationDatabase: return .compilationDatabase
983+
case .swiftPM: return .swiftPM
984984
}
985985
}
986986
}

Sources/SourceKitLSP/Workspace.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,14 @@ public final class Workspace {
130130
}
131131

132132
if let rootUrl = rootUri.fileURL, let rootPath = try? AbsolutePath(validating: rootUrl.path) {
133-
if let defaultWorkspaceType = buildSetup.defaultWorkspaceType, let defaultBuildSystem: BuildSystem? =
134-
switch defaultWorkspaceType {
135-
case .buildserver: await buildBuildServerWorkspace(rootPath: rootPath)
136-
case .compdb: buildCompDBWorkspace(rootPath: rootPath)
137-
case .swiftpm: await buildSwiftPMWorkspace(rootUrl: rootUrl)
138-
} {
133+
let defaultBuildSystem: BuildSystem? =
134+
switch buildSetup.defaultWorkspaceType {
135+
case .buildServer: await buildBuildServerWorkspace(rootPath: rootPath)
136+
case .compilationDatabase: buildCompDBWorkspace(rootPath: rootPath)
137+
case .swiftPM: await buildSwiftPMWorkspace(rootUrl: rootUrl)
138+
case nil: nil
139+
}
140+
if let defaultBuildSystem {
139141
buildSystem = defaultBuildSystem
140142
} else if let buildServer = await buildBuildServerWorkspace(rootPath: rootPath) {
141143
buildSystem = buildServer

Sources/sourcekit-lsp/SourceKitLSP.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ struct SourceKitLSP: ParsableCommand {
176176
var indexPrefixMappings = [PathPrefixMapping]()
177177

178178
@Option(
179-
name: .customLong("default-workspace-type"),
180-
help: "Override default workspace type selection; one of 'swiftpm', 'compdb', or 'buildserver'"
179+
help: "Override default workspace type selection; one of 'swiftPM', 'compilationDatabase', or 'buildServer'"
181180
)
182181
var defaultWorkspaceType: SKSupport.WorkspaceType?
183182

0 commit comments

Comments
 (0)