Skip to content

Commit 50a28bb

Browse files
committed
Change FIXME and TODO comments to always have an associated issue
Do one of the following for every `FIXME` or `TODO` comment - Add an issue that tracks the task - Remove the comment if we are not planning to address it
1 parent ce85cf7 commit 50a28bb

27 files changed

+61
-83
lines changed

Sources/BuildSystemIntegration/BuildServerBuildSystem.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,9 @@ extension BuildServerBuildSystem: BuildSystem {
334334
return .unhandled
335335
}
336336

337-
// FIXME: We should not make any assumptions about which files the build server can handle.
338-
// Instead we should query the build server which files it can handle (#492).
337+
// TODO: We should not make any assumptions about which files the build server can handle.
338+
// Instead we should query the build server which files it can handle
339+
// (https://github.com/swiftlang/sourcekit-lsp/issues/492).
339340

340341
if projectRoot.isAncestorOfOrEqual(to: path) {
341342
return .handled
@@ -399,8 +400,7 @@ private func makeJSONRPCBuildServer(
399400
)
400401

401402
connection.start(receiveHandler: client) {
402-
// FIXME: keep the pipes alive until we close the connection. This
403-
// should be fixed systemically.
403+
// Keep the pipes alive until we close the connection.
404404
withExtendedLifetime((clientToServer, serverToClient)) {}
405405
}
406406
let process = Foundation.Process()

Sources/BuildSystemIntegration/BuildSystemManager.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,11 @@ extension BuildSystemManager {
198198
guard let buildSystem, let target else {
199199
return nil
200200
}
201-
// FIXME: (async) We should only wait `fallbackSettingsTimeout` for build
202-
// settings and return fallback afterwards. I am not sure yet, how best to
203-
// implement that with Swift concurrency.
201+
// TODO: We should only wait `fallbackSettingsTimeout` for build settings
202+
// and return fallback afterwards.
204203
// For now, this should be fine because all build systems return
205204
// very quickly from `settings(for:language:)`.
205+
// https://github.com/apple/sourcekit-lsp/issues/1181
206206
return try await buildSystem.buildSettings(for: document, in: target, language: language)
207207
}
208208

@@ -382,7 +382,6 @@ extension BuildSystemManager: BuildSystemDelegate {
382382
}
383383

384384
extension BuildSystemManager {
385-
// FIXME: Consider debouncing/limiting this, seems to trigger often during a build.
386385
/// Checks if there are any files in `mainFileAssociations` where the main file
387386
/// that we have stored has changed.
388387
///

Sources/BuildSystemIntegration/SwiftPMBuildSystem.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,7 @@ extension SwiftPMBuildSystem: BuildSystemIntegration.BuildSystem {
530530
}
531531

532532
package func defaultLanguage(for document: DocumentURI) -> Language? {
533-
// TODO (indexing): Query The SwiftPM build system for the document's language.
534-
// https://github.com/swiftlang/sourcekit-lsp/issues/1267
533+
// TODO: Query The SwiftPM build system for the document's language. (https://github.com/swiftlang/sourcekit-lsp/issues/1267)
535534
return nil
536535
}
537536

@@ -602,8 +601,7 @@ extension SwiftPMBuildSystem: BuildSystemIntegration.BuildSystem {
602601
targets: [ConfiguredTarget],
603602
logMessageToIndexLog: @escaping @Sendable (_ taskID: IndexTaskID, _ message: String) -> Void
604603
) async throws {
605-
// TODO (indexing): Support preparation of multiple targets at once.
606-
// https://github.com/swiftlang/sourcekit-lsp/issues/1262
604+
// TODO: Support preparation of multiple targets at once. (https://github.com/swiftlang/sourcekit-lsp/issues/1262)
607605
for target in targets {
608606
await orLog("Preparing") { try await prepare(singleTarget: target, logMessageToIndexLog: logMessageToIndexLog) }
609607
}
@@ -620,8 +618,7 @@ extension SwiftPMBuildSystem: BuildSystemIntegration.BuildSystem {
620618
return
621619
}
622620

623-
// TODO (indexing): Add a proper 'prepare' job in SwiftPM instead of building the target.
624-
// https://github.com/swiftlang/sourcekit-lsp/issues/1254
621+
// TODO: Add a proper 'prepare' job in SwiftPM instead of building the target. (https://github.com/swiftlang/sourcekit-lsp/issues/1254)
625622
guard let swift = toolchain.swift else {
626623
logger.error(
627624
"Not preparing because toolchain at \(self.toolchain.identifier) does not contain a Swift compiler"
@@ -757,7 +754,6 @@ extension SwiftPMBuildSystem: BuildSystemIntegration.BuildSystem {
757754
if events.contains(where: { self.fileEventShouldTriggerPackageReload(event: $0) }) {
758755
logger.log("Reloading package because of file change")
759756
await orLog("Reloading package") {
760-
// TODO: It should not be necessary to reload the entire package just to get build settings for one file.
761757
try await self.reloadPackage(forceResolvedVersions: !isForIndexBuild)
762758
}
763759
}

Sources/CSKTestSupport/CSKTestSupport.c

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

1313
#ifdef __linux__
1414
// For testing, override __cxa_atexit to prevent registration of static
15-
// destructors due to SR-12668.
15+
// destructors due to https://github.com/swiftlang/swift/issues/55112.
1616
int __cxa_atexit(void (*f) (void *), void *arg, void *dso_handle) {
1717
return 0;
1818
}

Sources/Diagnose/StderrStreamConcurrencySafe.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import class TSCBasic.ThreadSafeOutputByteStream
1616
#if canImport(Darwin)
1717
import TSCLibc
1818
#else
19-
// FIXME: (async-workaround) @preconcurrency needed because stderr is not sendable on Linux rdar://125578486
19+
// TODO: @preconcurrency needed because stderr is not sendable on Linux https://github.com/swiftlang/swift/issues/75601
2020
@preconcurrency import TSCLibc
2121
#endif
2222

Sources/LanguageServerProtocol/SupportTypes/ClientCapabilities.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ public struct RefreshRegistrationCapability: Hashable, Codable, Sendable {
7070
}
7171

7272
/// Capabilities of the client editor/IDE related to managing the workspace.
73-
// FIXME: Instead of making all of these optional, provide default values and make the deserialization handle missing values.
7473
public struct WorkspaceClientCapabilities: Hashable, Codable, Sendable {
7574

7675
/// Capabilities specific to `WorkspaceEdit`.
@@ -223,7 +222,6 @@ public struct WorkspaceClientCapabilities: Hashable, Codable, Sendable {
223222
}
224223

225224
/// Capabilities of the client editor/IDE related to the document.
226-
// FIXME: Instead of making all of these optional, provide default values and make the deserialization handle missing values.
227225
public struct TextDocumentClientCapabilities: Hashable, Codable, Sendable {
228226

229227
/// Capabilities specific to the `textDocument/...` change notifications.

Sources/LanguageServerProtocol/SupportTypes/CodeActionKind.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ public struct CodeActionKind: RawRepresentable, Codable, Hashable, Sendable {
3737
public static let refactorInline: CodeActionKind = CodeActionKind(rawValue: "refactor.inline")
3838

3939
/// Refactoring rewrite action.
40-
// FIXME: what is this?
4140
public static let refactorRewrite: CodeActionKind = CodeActionKind(rawValue: "refactor.rewrite")
4241

4342
/// Source action that applies to the entire file.
44-
// FIXME: what is this?
4543
public static let source: CodeActionKind = CodeActionKind(rawValue: "source")
4644

4745
/// Organize imports action.

Sources/LanguageServerProtocolJSONRPC/MessageSplitting.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ extension RandomAccessCollection where Element: Equatable {
104104
return nil
105105
}
106106

107-
// FIXME: use a better algorithm (e.g. Boyer-Moore-Horspool).
108107
var i = startIndex
109108
for _ in 0..<(count - pattern.count + 1) {
110109
if self[i...].starts(with: pattern) {

Sources/SKTestSupport/TestJSONRPCConnection.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,11 @@ package final class TestJSONRPCConnection: Sendable {
5959
server = TestServer(client: serverToClientConnection)
6060

6161
clientToServerConnection.start(receiveHandler: client) {
62-
// FIXME: keep the pipes alive until we close the connection. This
63-
// should be fixed systemically.
62+
// Keep the pipes alive until we close the connection.
6463
withExtendedLifetime(self) {}
6564
}
6665
serverToClientConnection.start(receiveHandler: server) {
67-
// FIXME: keep the pipes alive until we close the connection. This
68-
// should be fixed systemically.
66+
// Keep the pipes alive until we close the connection.
6967
withExtendedLifetime(self) {}
7068
}
7169
}

Sources/SemanticIndex/SemanticIndexManager.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ package final actor SemanticIndexManager {
273273
// potentially not knowing about unit files, which causes the corresponding source files to be re-indexed.
274274
index.pollForUnitChangesAndWait()
275275
await testHooks.buildGraphGenerationDidFinish?()
276-
// FIXME: (async-workaround) Ideally this would be a type like any Collection<DocumentURI> & Sendable but that
277-
// doesn't work due to rdar://132374933
276+
// TODO: Ideally this would be a type like any Collection<DocumentURI> & Sendable but that doesn't work due to
277+
// https://github.com/swiftlang/swift/issues/75602
278278
var filesToIndex: [DocumentURI] = await self.buildSystemManager.sourceFiles().lazy.map(\.uri)
279279
if !indexFilesWithUpToDateUnit {
280280
let index = index.checked(for: .modifiedFiles)
@@ -626,9 +626,9 @@ package final actor SemanticIndexManager {
626626

627627
var indexTasks: [Task<Void, Never>] = []
628628

629-
// TODO (indexing): When we can index multiple targets concurrently in SwiftPM, increase the batch size to half the
629+
// TODO: When we can index multiple targets concurrently in SwiftPM, increase the batch size to half the
630630
// processor count, so we can get parallelism during preparation.
631-
// https://github.com/swiftlang/sourcekit-lsp/issues/1262
631+
// (https://github.com/swiftlang/sourcekit-lsp/issues/1262)
632632
for targetsBatch in sortedTargets.partition(intoBatchesOfSize: 1) {
633633
let preparationTaskID = UUID()
634634
let indexTask = Task(priority: priority) {
@@ -638,9 +638,9 @@ package final actor SemanticIndexManager {
638638
// And after preparation is done, index the files in the targets.
639639
await withTaskGroup(of: Void.self) { taskGroup in
640640
for target in targetsBatch {
641-
// TODO (indexing): Once swiftc supports indexing of multiple files in a single invocation, increase the
642-
// batch size to allow it to share AST builds between multiple files within a target.
643-
// https://github.com/swiftlang/sourcekit-lsp/issues/1268
641+
// TODO: Once swiftc supports indexing of multiple files in a single invocation, increase the batch size to
642+
// allow it to share AST builds between multiple files within a target.
643+
// (https://github.com/swiftlang/sourcekit-lsp/issues/1268)
644644
for fileBatch in filesByTarget[target]!.partition(intoBatchesOfSize: 1) {
645645
taskGroup.addTask {
646646
await self.updateIndexStore(

0 commit comments

Comments
 (0)