Skip to content

Commit 1ba8552

Browse files
authored
Merge pull request #2505 from hborla/lexical-context-default
[Macros] Add a default implementation of `MacroExpansionContext.lexicalContext`.
2 parents 57d102f + a5274f2 commit 1ba8552

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/SwiftSyntaxMacros/MacroExpansionContext.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ extension MacroExpansionContext {
8181
) -> AbstractSourceLocation? {
8282
return location(of: node, at: .afterLeadingTrivia, filePathMode: .fileID)
8383
}
84+
85+
public var lexicalContext: [Syntax] {
86+
fatalError(
87+
"`MacroExpansionContext` conformance must implement `lexicalContext`"
88+
)
89+
}
8490
}
8591

8692
/// Diagnostic message used for thrown errors.

0 commit comments

Comments
 (0)