Skip to content

Commit 5cdf908

Browse files
committed
Perform request on a position range
1 parent 8899db8 commit 5cdf908

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Sources/LanguageServerProtocol/Requests/MacroExpansionRequest.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
///
1616
/// - Parameters:
1717
/// - textDocument: The document in which the macro is used.
18-
/// - position: The position at which the macro is used.
18+
/// - range: The range at which the macro is used.
1919
///
2020
/// - Returns: The macro expansion.
2121
public struct MacroExpansionRequest: TextDocumentRequest, Hashable {
@@ -26,13 +26,14 @@ public struct MacroExpansionRequest: TextDocumentRequest, Hashable {
2626
public var textDocument: TextDocumentIdentifier
2727

2828
/// The position at which the macro is used.
29-
public var position: Position
29+
@CustomCodable<PositionRange>
30+
public var range: Range<Position>
3031

3132
public init(
3233
textDocument: TextDocumentIdentifier,
33-
position: Position
34+
range: Range<Position>
3435
) {
3536
self.textDocument = textDocument
36-
self.position = position
37+
self._range = CustomCodable(wrappedValue: range)
3738
}
3839
}

Sources/SourceKitLSP/Swift/SwiftLanguageServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,7 @@ extension SwiftLanguageServer {
13031303
let command = SemanticRefactorCommand(
13041304
title: "Expand Macro",
13051305
actionString: "source.refactoring.kind.expand.macro",
1306-
positionRange: req.position..<req.position,
1306+
positionRange: req.range,
13071307
textDocument: req.textDocument
13081308
)
13091309

0 commit comments

Comments
 (0)