Skip to content

Fix yaml lint error and remove offensive terms from the codebase #2042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Documentation/Configuration File.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion Sources/SKLogging/SetGlobalLogFileHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/SKOptions/SourceKitLSPOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions Sources/SourceKitLSP/Clang/ClangLanguageService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/SourceKitLSP/Swift/SwiftLanguageService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ fileprivate extension Range {
}
}

/// Explicitly blacklisted `DocumentURI` schemes.
/// Explicitly excluded `DocumentURI` schemes.
fileprivate let excludedDocumentURISchemes: [String] = [
"git",
"hg",
]

/// 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
Expand Down
4 changes: 2 additions & 2 deletions Sources/TSCExtensions/Process+Run.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions Tests/SourceKitDTests/CrashRecoveryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)..<Position(line: 1, utf16index: 9)

Expand All @@ -181,7 +181,7 @@ final class CrashRecoveryTests: XCTestCase {
let preCrashHoverResponse = try await testClient.send(hoverRequest)
precondition(
preCrashHoverResponse?.range == expectedHoverRange,
"Sanity check failed. The Hover response was not what we expected, even before crashing sourcekitd"
"Precondition test failed. The Hover response was not what we expected, even before crashing sourcekitd"
)

// Crash clangd
Expand Down Expand Up @@ -218,7 +218,7 @@ final class CrashRecoveryTests: XCTestCase {

let (mainUri, positions) = try project.openDocument("main.cpp")

// 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 expectedHighlightResponse = [
DocumentHighlight(range: positions["1️⃣"]..<positions["2️⃣"], kind: .text),
Expand All @@ -232,7 +232,7 @@ final class CrashRecoveryTests: XCTestCase {
let preCrashHighlightResponse = try await project.testClient.send(highlightRequest)
precondition(
preCrashHighlightResponse == expectedHighlightResponse,
"Sanity check failed. The Hover response was not what we expected, even before crashing sourcekitd"
"Precondition test failed. The Hover response was not what we expected, even before crashing sourcekitd"
)

// Crash clangd
Expand Down
2 changes: 1 addition & 1 deletion Tests/SourceKitLSPTests/CompilationDatabaseTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class CompilationDatabaseTests: XCTestCase {

let (mainUri, positions) = try project.openDocument("main.cpp")

// Do a sanity check and verify that we get the expected result from a hover response before modifying the compile commands.
// Verify that we get the expected result from a hover response before modifying the compile commands.

let highlightRequest = DocumentHighlightRequest(
textDocument: TextDocumentIdentifier(mainUri),
Expand Down
2 changes: 1 addition & 1 deletion Tests/SourceKitLSPTests/SwiftInterfaceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class SwiftInterfaceTests: XCTestCase {
let location = try XCTUnwrap(resp?.locations?.only)
XCTAssertTrue(location.uri.pseudoPath.hasSuffix("Foundation.swiftinterface"))
let fileContents = try XCTUnwrap(location.uri.fileURL.flatMap({ try String(contentsOf: $0, encoding: .utf8) }))
// Sanity-check that the generated Swift Interface contains Swift code
// Smoke test that the generated Swift Interface contains Swift code
XCTAssert(
fileContents.hasPrefix("import "),
"Expected that the foundation swift interface starts with 'import ' but got '\(fileContents.prefix(100))'"
Expand Down
4 changes: 2 additions & 2 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@
"type" : "object"
},
"updateIndexStoreTimeout" : {
"description" : "Number of seconds to wait for an update index store task to finish before killing it.",
"markdownDescription" : "Number of seconds to wait for an update index store task to finish before killing it.",
"description" : "Number of seconds to wait for an update index store task to finish before terminating it.",
"markdownDescription" : "Number of seconds to wait for an update index store task to finish before terminating it.",
"type" : "integer"
}
},
Expand Down