Skip to content

Commit 18935ab

Browse files
committed
Apply DeMorgan's Law
created `ApplyDeMorganLaw` to provide code actions for generalised DeMorgan's conversion - matches with the outermost applicable expression - supports both logical and bitwise expressions - parentheses are created minimally added SwiftOperators from swift-syntax as a new dependency to SourceKitLSP registered in `SyntaxCodeActions.allSyntaxCodeActions` registered in Sources/SourceKitLSP/CMakeLists.txt added tests in `CodeActionTests`
1 parent 607292a commit 18935ab

File tree

5 files changed

+641
-0
lines changed

5 files changed

+641
-0
lines changed

Package.swift

+1
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ let package = Package(
383383
.product(name: "Crypto", package: "swift-crypto"),
384384
.product(name: "SwiftDiagnostics", package: "swift-syntax"),
385385
.product(name: "SwiftIDEUtils", package: "swift-syntax"),
386+
.product(name: "SwiftOperators", package: "swift-syntax"),
386387
.product(name: "SwiftParser", package: "swift-syntax"),
387388
.product(name: "SwiftParserDiagnostics", package: "swift-syntax"),
388389
.product(name: "SwiftRefactor", package: "swift-syntax"),

Sources/SourceKitLSP/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ target_sources(SourceKitLSP PRIVATE
2929
target_sources(SourceKitLSP PRIVATE
3030
Swift/AdjustPositionToStartOfIdentifier.swift
3131
Swift/CodeActions/AddDocumentation.swift
32+
Swift/CodeActions/ApplyDeMorganLaw.swift
3233
Swift/CodeActions/ConvertIntegerLiteral.swift
3334
Swift/CodeActions/ConvertJSONToCodableStruct.swift
3435
Swift/CodeActions/PackageManifestEdits.swift

0 commit comments

Comments
 (0)