Skip to content

Implement SwiftFixIt — a library for deserializing diagnostics and applying fix-its #8585

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
May 2, 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
19 changes: 19 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,21 @@ let package = Package(
]
),

.target(
/** API for deserializing diagnostics and applying fix-its */
name: "SwiftFixIt",
dependencies: [
"Basics",
.product(name: "TSCBasic", package: "swift-tools-support-core"),
] + swiftSyntaxDependencies(
["SwiftDiagnostics", "SwiftIDEUtils", "SwiftParser", "SwiftSyntax"]
),
exclude: ["CMakeLists.txt"],
swiftSettings: commonExperimentalFeatures + [
.unsafeFlags(["-static"]),
]
),

// MARK: Project Model

.target(
Expand Down Expand Up @@ -916,6 +931,10 @@ let package = Package(
dependencies: ["SourceControl", "_InternalTestSupport"],
exclude: ["Inputs/TestRepo.tgz"]
),
.testTarget(
name: "SwiftFixItTests",
dependencies: ["SwiftFixIt", "_InternalTestSupport"]
),
.testTarget(
name: "XCBuildSupportTests",
dependencies: ["XCBuildSupport", "_InternalTestSupport", "_InternalBuildTestSupport"],
Expand Down
24 changes: 24 additions & 0 deletions Sources/SwiftFixIt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This source file is part of the Swift open source project
#
# Copyright (c) 2025 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors

add_library(SwiftFixIt STATIC
SwiftFixIt.swift)
target_link_libraries(SwiftFixIt PUBLIC
Basics

SwiftSyntax::SwiftDiagnostics
SwiftSyntax::SwiftIDEUtils
SwiftSyntax::SwiftParser
SwiftSyntax::SwiftSyntax

TSCBasic
TSCUtility
)

set_target_properties(SwiftFixIt PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
Loading