Skip to content

Commit 39d9077

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 d11c101 commit 39d9077

File tree

5 files changed

+850
-0
lines changed

5 files changed

+850
-0
lines changed

Package.swift

+1
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ let package = Package(
337337
.product(name: "Crypto", package: "swift-crypto"),
338338
.product(name: "SwiftDiagnostics", package: "swift-syntax"),
339339
.product(name: "SwiftIDEUtils", package: "swift-syntax"),
340+
.product(name: "SwiftOperators", package: "swift-syntax"),
340341
.product(name: "SwiftParser", package: "swift-syntax"),
341342
.product(name: "SwiftParserDiagnostics", package: "swift-syntax"),
342343
.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/ConvertStringConcatenationToStringInterpolation.swift

0 commit comments

Comments
 (0)