Skip to content

Commit 64f2aef

Browse files
committed
Fix build warnings
Quite a few of these were reminders to clean things up once we no longer need to support testing using compilers and sourcekitd from older toolchains.
1 parent fe5644b commit 64f2aef

File tree

13 files changed

+12
-113
lines changed

13 files changed

+12
-113
lines changed

Package.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,14 @@ var targets: [Target] = [
123123
.target(
124124
name: "CompletionScoring",
125125
dependencies: ["CCompletionScoring"],
126+
exclude: ["CMakeLists.txt"],
126127
swiftSettings: globalSwiftSettings
127128
),
128129

129130
.target(
130131
name: "CompletionScoringForPlugin",
131132
dependencies: ["CCompletionScoring"],
133+
exclude: ["CMakeLists.txt"],
132134
swiftSettings: globalSwiftSettings
133135
),
134136

@@ -549,6 +551,7 @@ var targets: [Target] = [
549551
"SwiftExtensionsForPlugin",
550552
"SwiftSourceKitPluginCommon",
551553
],
554+
exclude: ["CMakeLists.txt"],
552555
swiftSettings: globalSwiftSettings + [
553556
.unsafeFlags([
554557
"-module-alias", "SourceKitD=SourceKitDForPlugin",
@@ -568,6 +571,7 @@ var targets: [Target] = [
568571
"SwiftExtensionsForPlugin",
569572
"SKLoggingForPlugin",
570573
],
574+
exclude: ["CMakeLists.txt"],
571575
swiftSettings: globalSwiftSettings + [
572576
.unsafeFlags([
573577
"-module-alias", "SourceKitD=SourceKitDForPlugin",
@@ -590,6 +594,7 @@ var targets: [Target] = [
590594
"SwiftSourceKitPluginCommon",
591595
"SwiftExtensionsForPlugin",
592596
],
597+
exclude: ["CMakeLists.txt"],
593598
swiftSettings: globalSwiftSettings + [
594599
.unsafeFlags([
595600
"-module-alias", "CompletionScoring=CompletionScoringForPlugin",

Sources/BuildSystemIntegration/SwiftPMBuildSystem.swift

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -413,23 +413,7 @@ package actor SwiftPMBuildSystem: BuiltInBuildSystem {
413413

414414
throw NonFileURIError(uri: file)
415415
}
416-
let compileArguments = try buildTarget.compileArguments(for: fileURL)
417-
418-
#if compiler(>=6.1)
419-
#warning("When we drop support for Swift 5.10 we no longer need to adjust compiler arguments for the Modules move")
420-
#endif
421-
// Fix up compiler arguments that point to a `/Modules` subdirectory if the Swift version in the toolchain is less
422-
// than 6.0 because it places the modules one level higher up.
423-
let toolchainVersion = await orLog("Getting Swift version") { try await toolchain.swiftVersion }
424-
guard let toolchainVersion, toolchainVersion < SwiftVersion(6, 0) else {
425-
return compileArguments
426-
}
427-
return compileArguments.map { argument in
428-
if argument.hasSuffix("/Modules"), argument.contains(self.swiftPMWorkspace.location.scratchDirectory.pathString) {
429-
return String(argument.dropLast(8))
430-
}
431-
return argument
432-
}
416+
return try buildTarget.compileArguments(for: fileURL)
433417
}
434418

435419
package func buildTargets(request: WorkspaceBuildTargetsRequest) async throws -> WorkspaceBuildTargetsResponse {

Sources/SemanticIndex/UpdateIndexStoreTaskDescription.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -576,12 +576,6 @@ private func adjustClangCompilerArgumentsForIndexStoreUpdate(
576576
return result
577577
}
578578

579-
#if compiler(>=6.1)
580-
#warning(
581-
"Remove -fmodules-validate-system-headers from supplementalClangIndexingArgs once all supported Swift compilers have https://github.com/apple/swift/pull/74063"
582-
)
583-
#endif
584-
585579
fileprivate let supplementalClangIndexingArgs: [String] = [
586580
// Retain extra information for indexing
587581
"-fretain-comments-from-system-headers",
@@ -596,11 +590,6 @@ fileprivate let supplementalClangIndexingArgs: [String] = [
596590
"-Xclang", "-fallow-pcm-with-compiler-errors",
597591
"-Wno-non-modular-include-in-framework-module",
598592
"-Wno-incomplete-umbrella",
599-
600-
// sourcekitd adds `-fno-modules-validate-system-headers` before https://github.com/apple/swift/pull/74063.
601-
// This completely disables system module validation and never re-builds pcm for system modules. The intended behavior
602-
// is to only re-build those PCMs once per sourcekitd session.
603-
"-fmodules-validate-system-headers",
604593
]
605594

606595
fileprivate extension Sequence {

Sources/SourceKitLSP/Documentation/DocCServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ package struct DocCServer {
5858
let request = ConvertRequest(
5959
bundleInfo: DocumentationBundle.Info(
6060
displayName: documentationBundleDisplayName,
61-
identifier: documentationBundleIdentifier,
61+
id: DocumentationBundle.Identifier(rawValue: documentationBundleIdentifier),
6262
defaultCodeListingLanguage: nil,
6363
defaultAvailability: nil,
6464
defaultModuleKind: nil

Sources/SourceKitLSP/Swift/CursorInfo.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@ struct CursorInfo {
3030
/// The annotated declaration XML string.
3131
var annotatedDeclaration: String?
3232

33-
#if swift(>=6.2)
34-
#warning(
35-
"Documentation transitioned from XML to the raw string in Swift 6.0. We should be able to remove documentationXML now"
36-
)
37-
#endif
38-
/// The documentation comment XML string. The schema is at
39-
/// https://github.com/apple/swift/blob/main/bindings/xml/comment-xml-schema.rng
40-
var documentationXML: String?
41-
4233
/// The documentation as it is spelled in
4334
var documentation: String?
4435

@@ -48,12 +39,10 @@ struct CursorInfo {
4839
init(
4940
_ symbolInfo: SymbolDetails,
5041
annotatedDeclaration: String?,
51-
documentationXML: String?,
5242
documentation: String?
5343
) {
5444
self.symbolInfo = symbolInfo
5545
self.annotatedDeclaration = annotatedDeclaration
56-
self.documentationXML = documentationXML
5746
self.documentation = documentation
5847
}
5948

@@ -106,7 +95,6 @@ struct CursorInfo {
10695
systemModule: module
10796
),
10897
annotatedDeclaration: dict[keys.annotatedDecl],
109-
documentationXML: dict[keys.docFullAsXML],
11098
documentation: dict[keys.docComment]
11199
)
112100
}

Sources/SourceKitLSP/Swift/SwiftLanguageService.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -741,10 +741,6 @@ extension SwiftLanguageService {
741741
}
742742
result += documentation
743743
return result
744-
} else if let doc = cursorInfo.documentationXML {
745-
return """
746-
\(orLog("Convert XML to Markdown") { try xmlDocumentationToMarkdown(doc) } ?? doc)
747-
"""
748744
} else if let annotated: String = cursorInfo.annotatedDeclaration {
749745
return """
750746
\(orLog("Convert XML to Markdown") { try xmlDocumentationToMarkdown(annotated) } ?? annotated)

Sources/SwiftExtensions/Atomics.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212

1313
import CAtomics
1414

15-
#if compiler(>=6.2)
16-
#warning("We should be able to use atomics in the stdlib when we raise the deployment target to require Swift 6")
17-
#endif
18-
15+
// TODO: Use atomic types from the standard library (https://github.com/swiftlang/sourcekit-lsp/issues/1949)
1916
package final class AtomicBool: Sendable {
2017
private nonisolated(unsafe) let atomic: UnsafeMutablePointer<CAtomicUInt32>
2118

Sources/SwiftSourceKitPlugin/Plugin.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public func sourcekitd_plugin_initialize_2(
246246
)
247247
} else {
248248
DynamicallyLoadedSourceKitD.forPlugin = try! DynamicallyLoadedSourceKitD.inProcLibrary(
249-
relativeTo: URL(fileURLWithPath: String(cString: parentLibraryPath))
249+
relativeTo: URL(fileURLWithPath: parentLibraryPath)
250250
)
251251
}
252252
#else

Tests/CompletionScoringPerfTests/Supporting Files/CodeCompletionFoundationPerfTests-Info.plist

Lines changed: 0 additions & 22 deletions
This file was deleted.

Tests/CompletionScoringTests/Supporting Files/CodeCompletionFoundationTests-Info.plist

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)