From 1efbba325c8945c8ed27bd1f38110761af7c9011 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Thu, 6 Mar 2025 22:04:21 -0800 Subject: [PATCH 1/2] Fix yaml lint error --- .github/ISSUE_TEMPLATE/config.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index f689e31e..00d5ca0a 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,12 +1,12 @@ # This source file is part of the Swift.org open source project - # - # Copyright (c) 2024 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 - # See https://swift.org/CONTRIBUTORS.txt for Swift project authors +# +# Copyright (c) 2024 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 +# See https://swift.org/CONTRIBUTORS.txt for Swift project authors - contact_links: - - name: Discussion Forum - url: https://forums.swift.org/c/development/sourcekit-lsp - about: Ask and answer questions about SourceKit-LSP +contact_links: + - name: Discussion Forum + url: https://forums.swift.org/c/development/sourcekit-lsp + about: Ask and answer questions about SourceKit-LSP From 8aa8fa0ff8e043f80c2870d37ab074c0190ddb84 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Fri, 7 Mar 2025 13:58:02 -0800 Subject: [PATCH 2/2] Remove offensive terms from the codebase --- Documentation/Configuration File.md | 2 +- .../VersionedTextDocumentIdentifier.swift | 2 +- Sources/SKLogging/SetGlobalLogFileHandler.swift | 2 +- Sources/SKOptions/SourceKitLSPOptions.swift | 2 +- .../SourceKitLSP/Clang/ClangLanguageService.swift | 6 +++--- .../SourceKitLSP/Swift/SwiftLanguageService.swift | 6 +++--- Sources/TSCExtensions/Process+Run.swift | 4 ++-- Tests/SourceKitDTests/CrashRecoveryTests.swift | 12 ++++++------ .../SourceKitLSPTests/CompilationDatabaseTests.swift | 2 +- Tests/SourceKitLSPTests/SwiftInterfaceTests.swift | 2 +- config.schema.json | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Documentation/Configuration File.md b/Documentation/Configuration File.md index 32da2f3d..59fde382 100644 --- a/Documentation/Configuration File.md +++ b/Documentation/Configuration File.md @@ -38,7 +38,7 @@ The structure of the file is currently not guaranteed to be stable. Options may - `clangdOptions: string[]`: Extra command line arguments passed to `clangd` when launching it. - `index`: Options related to indexing. - `indexPrefixMap: [string: string]`: Path remappings for remapping index data for local use. - - `updateIndexStoreTimeout: integer`: Number of seconds to wait for an update index store task to finish before killing it. + - `updateIndexStoreTimeout: integer`: Number of seconds to wait for an update index store task to finish before terminating it. - `logging`: Options related to logging, changing SourceKit-LSP’s logging behavior on non-Apple platforms. On Apple platforms, logging is done through the [system log](Diagnose%20Bundle.md#Enable%20Extended%20Logging). These options can only be set globally and not per workspace. - `level: "debug"|"info"|"default"|"error"|"fault"`: The level from which one onwards log messages should be written. - `privacyLevel: "public"|"private"|"sensitive"`: Whether potentially sensitive information should be redacted. Default is `public`, which redacts potentially sensitive information. diff --git a/Sources/LanguageServerProtocol/SupportTypes/VersionedTextDocumentIdentifier.swift b/Sources/LanguageServerProtocol/SupportTypes/VersionedTextDocumentIdentifier.swift index d0e628be..320bac97 100644 --- a/Sources/LanguageServerProtocol/SupportTypes/VersionedTextDocumentIdentifier.swift +++ b/Sources/LanguageServerProtocol/SupportTypes/VersionedTextDocumentIdentifier.swift @@ -42,7 +42,7 @@ public struct OptionalVersionedTextDocumentIdentifier: Hashable, Codable, Sendab /// identifier is sent from the server to the client and the file is not /// open in the editor (the server has not received an open notification /// before) the server can send `null` to indicate that the version is - /// known and the content on disk is the master (as specified with document + /// known and the content on disk is the primary (as specified with document /// content ownership). /// /// The version number of a document will increase after each change, diff --git a/Sources/SKLogging/SetGlobalLogFileHandler.swift b/Sources/SKLogging/SetGlobalLogFileHandler.swift index 76d81536..0a15a02a 100644 --- a/Sources/SKLogging/SetGlobalLogFileHandler.swift +++ b/Sources/SKLogging/SetGlobalLogFileHandler.swift @@ -144,7 +144,7 @@ private func isProcessAlive(pid: Int32) -> Bool { } return false #else - return kill(pid, 0) == 0 + return kill(pid, 0) == 0 // ignore-unacceptable-language #endif } diff --git a/Sources/SKOptions/SourceKitLSPOptions.swift b/Sources/SKOptions/SourceKitLSPOptions.swift index 456c2171..acfd17ef 100644 --- a/Sources/SKOptions/SourceKitLSPOptions.swift +++ b/Sources/SKOptions/SourceKitLSPOptions.swift @@ -179,7 +179,7 @@ public struct SourceKitLSPOptions: Sendable, Codable, Equatable { /// /// - Note: Internal option, may not work as intended public var maxCoresPercentageToUseForBackgroundIndexing: Double? - /// Number of seconds to wait for an update index store task to finish before killing it. + /// Number of seconds to wait for an update index store task to finish before terminating it. public var updateIndexStoreTimeout: Int? public var maxCoresPercentageToUseForBackgroundIndexingOrDefault: Double { diff --git a/Sources/SourceKitLSP/Clang/ClangLanguageService.swift b/Sources/SourceKitLSP/Clang/ClangLanguageService.swift index c3f9990d..9a2a7735 100644 --- a/Sources/SourceKitLSP/Clang/ClangLanguageService.swift +++ b/Sources/SourceKitLSP/Clang/ClangLanguageService.swift @@ -318,19 +318,19 @@ actor ClangLanguageService: LanguageService, MessageHandler { } func crash() { - // Since `clangd` doesn't have a method to crash it, kill it. + // Since `clangd` doesn't have a method to crash it, terminate it. #if os(Windows) if self.hClangd != INVALID_HANDLE_VALUE { // We can potentially deadlock the process if a kobject is a pending state. // Unfortunately, the `OpenProcess(PROCESS_TERMINATE, ...)`, `CreateRemoteThread`, `ExitProcess` dance, while - // safer, can also indefinitely hang as `CreateRemoteThread` may not be serviced depending on the state of + // safer, can also indefinitely spin as `CreateRemoteThread` may not be serviced depending on the state of // the process. This just attempts to terminate the process, risking a deadlock and resource leaks, which is fine // since we only use `crash` from tests. _ = TerminateProcess(self.hClangd, 255) } #else if let pid = self.clangdPid { - kill(pid, SIGKILL) + kill(pid, SIGKILL) // ignore-unacceptable-language } #endif } diff --git a/Sources/SourceKitLSP/Swift/SwiftLanguageService.swift b/Sources/SourceKitLSP/Swift/SwiftLanguageService.swift index c65cd0e2..17495cd4 100644 --- a/Sources/SourceKitLSP/Swift/SwiftLanguageService.swift +++ b/Sources/SourceKitLSP/Swift/SwiftLanguageService.swift @@ -51,7 +51,7 @@ fileprivate extension Range { } } -/// Explicitly blacklisted `DocumentURI` schemes. +/// Explicitly excluded `DocumentURI` schemes. fileprivate let excludedDocumentURISchemes: [String] = [ "git", "hg", @@ -59,9 +59,9 @@ fileprivate let excludedDocumentURISchemes: [String] = [ /// Returns true if diagnostics should be emitted for the given document. /// -/// Some editors (like Visual Studio Code) use non-file URLs to manage source control diff bases +/// Some editors (like Visual Studio Code) use non-file URLs to manage source control diff bases /// for the active document, which can lead to duplicate diagnostics in the Problems view. -/// As a workaround we explicitly blacklist those URIs and don't emit diagnostics for them. +/// As a workaround we explicitly exclude those URIs and don't emit diagnostics for them. /// /// Additionally, as of Xcode 11.4, sourcekitd does not properly handle non-file URLs when /// the `-working-directory` argument is passed since it incorrectly applies it to the input diff --git a/Sources/TSCExtensions/Process+Run.swift b/Sources/TSCExtensions/Process+Run.swift index c602b9e7..4872f3da 100644 --- a/Sources/TSCExtensions/Process+Run.swift +++ b/Sources/TSCExtensions/Process+Run.swift @@ -28,7 +28,7 @@ import Android extension Process { /// Wait for the process to exit. If the task gets cancelled, during this time, send a `SIGINT` to the process. - /// Should the process not terminate on SIGINT after 2 seconds, it is killed using `SIGKILL`. + /// Should the process not terminate on SIGINT after 2 seconds, it is terminated using `SIGKILL`. @discardableResult package func waitUntilExitStoppingProcessOnTaskCancellation() async throws -> ProcessResult { let hasExited = AtomicBool(initialValue: false) @@ -40,7 +40,7 @@ extension Process { } onCancel: { signal(SIGINT) Task { - // Give the process 2 seconds to react to a SIGINT. If that doesn't work, kill the process. + // Give the process 2 seconds to react to a SIGINT. If that doesn't work, terminate the process. try await Task.sleep(for: .seconds(2)) if !hasExited.value { #if os(Windows) diff --git a/Tests/SourceKitDTests/CrashRecoveryTests.swift b/Tests/SourceKitDTests/CrashRecoveryTests.swift index ae8caf31..04e946e5 100644 --- a/Tests/SourceKitDTests/CrashRecoveryTests.swift +++ b/Tests/SourceKitDTests/CrashRecoveryTests.swift @@ -63,13 +63,13 @@ final class CrashRecoveryTests: XCTestCase { // Wait for diagnostics to be produced to make sure the document open got handled by sourcekitd. _ = try await testClient.nextDiagnosticsNotification() - // Do a sanity check and verify that we get the expected result from a hover response before crashing sourcekitd. + // Verify that we get the expected result from a hover response before crashing sourcekitd. let hoverRequest = HoverRequest(textDocument: TextDocumentIdentifier(uri), position: positions["1️⃣"]) let preCrashHoverResponse = try await testClient.send(hoverRequest) precondition( preCrashHoverResponse?.contains(string: "foo()") ?? false, - "Sanity check failed. The Hover response did not contain foo(), even before crashing sourcekitd. Received response: \(String(describing: preCrashHoverResponse))" + "Precondition test failed. The Hover response did not contain foo(), even before crashing sourcekitd. Received response: \(String(describing: preCrashHoverResponse))" ) testClient.handleSingleRequest { (request: CreateWorkDoneProgressRequest) -> VoidResponse in @@ -170,7 +170,7 @@ final class CrashRecoveryTests: XCTestCase { ) ) - // Do a sanity check and verify that we get the expected result from a hover response before crashing clangd. + // Verify that we get the expected result from a hover response before crashing clangd. let expectedHoverRange = Position(line: 1, utf16index: 5)..