@@ -15,27 +15,27 @@ import SwiftSyntax
15
15
16
16
public enum LexicalScopes {
17
17
/// Given syntax node position, returns all available labeled statements.
18
- public static func lookupLabeledStmts( at syntax: SyntaxProtocol ) -> [ LabeledStmtSyntax ] {
18
+ @ _spi ( Compiler ) @ _spi ( Testing ) public static func lookupLabeledStmts( at syntax: SyntaxProtocol ) -> [ LabeledStmtSyntax ] {
19
19
guard let scope = syntax. scope else { return [ ] }
20
20
return scope. lookupLabeledStmts ( at: syntax)
21
21
}
22
22
23
23
/// Given syntax node position, returns the current switch case and it's fallthrough destination.
24
- public static func lookupFallthroughSourceAndDest(
24
+ @ _spi ( Compiler ) @ _spi ( Testing ) public static func lookupFallthroughSourceAndDest(
25
25
at syntax: SyntaxProtocol
26
26
) -> ( source: SwitchCaseSyntax ? , destination: SwitchCaseSyntax ? ) {
27
27
guard let scope = syntax. scope else { return ( nil , nil ) }
28
28
return scope. lookupFallthroughSourceAndDestination ( at: syntax)
29
29
}
30
30
31
31
/// Given syntax node position, returns the closest ancestor catch node.
32
- public static func lookupCatchNode( at syntax: SyntaxProtocol ) -> Syntax ? {
32
+ @ _spi ( Compiler ) @ _spi ( Testing ) public static func lookupCatchNode( at syntax: SyntaxProtocol ) -> Syntax ? {
33
33
guard let scope = syntax. scope else { return nil }
34
34
return scope. lookupCatchNode ( at: Syntax ( syntax) )
35
35
}
36
36
37
37
/// Given name and syntax node position, return referenced declaration.
38
- public static func lookupDeclarationFor( name: String , at syntax: SyntaxProtocol ) -> Syntax ? {
38
+ @ _spi ( Compiler ) @ _spi ( Testing ) public static func lookupDeclarationFor( name: String , at syntax: SyntaxProtocol ) -> Syntax ? {
39
39
guard let scope = syntax. scope else { return nil }
40
40
return scope. getDeclarationFor ( name: name, at: syntax)
41
41
}
0 commit comments