File tree 1 file changed +13
-1
lines changed
Sources/SourceKitLSP/Swift 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -799,15 +799,27 @@ extension SwiftLanguageService {
799
799
additionalParameters: additionalCursorInfoParameters
800
800
)
801
801
802
- return cursorInfoResponse. refactorActions. compactMap {
802
+ var canInlineMacro = false
803
+
804
+ var refactorActions = cursorInfoResponse. refactorActions. compactMap {
803
805
do {
804
806
let lspCommand = try $0. asCommand ( )
807
+ canInlineMacro = $0. title == " Inline Macro "
805
808
return CodeAction ( title: $0. title, kind: . refactor, command: lspCommand)
806
809
} catch {
807
810
logger. log ( " Failed to convert SwiftCommand to Command type: \( error. forLogging) " )
808
811
return nil
809
812
}
810
813
}
814
+
815
+ if ( canInlineMacro) {
816
+ let expandMacroCommand = try ! ExpandMacroCommand ( positionRange: params. range, textDocument: params. textDocument)
817
+ . asCommand ( )
818
+
819
+ refactorActions. append ( CodeAction ( title: expandMacroCommand. title, kind: . refactor, command: expandMacroCommand) )
820
+ }
821
+
822
+ return refactorActions
811
823
}
812
824
813
825
func retrieveQuickFixCodeActions( _ params: CodeActionRequest ) async throws -> [ CodeAction ] {
You can’t perform that action at this time.
0 commit comments