File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Sources/SwiftLanguageService Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ final class PlaygroundMacroFinder: SyntaxAnyVisitor {
4848 private var result : [ PlaygroundItem ] = [ ]
4949
5050 /// Keep track of if "Playgrounds" has been imported
51- private var isPlaygroundImported : Bool = false
51+ fileprivate var isPlaygroundImported : Bool = false
5252
5353 private init ( baseID: String , snapshot: DocumentSnapshot ) {
5454 self . baseID = baseID
@@ -70,7 +70,7 @@ final class PlaygroundMacroFinder: SyntaxAnyVisitor {
7070 }
7171 let visitor = PlaygroundMacroFinder ( baseID: " \( moduleName) / \( baseName) " , snapshot: snapshot)
7272 visitor. walk ( node)
73- return visitor. result
73+ return visitor. isPlaygroundImported ? visitor . result : [ ]
7474 }
7575
7676 /// Add a playground location with the given parameters to the `result` array.
@@ -99,7 +99,7 @@ final class PlaygroundMacroFinder: SyntaxAnyVisitor {
9999 }
100100
101101 override func visit( _ node: MacroExpansionExprSyntax ) -> SyntaxVisitorContinueKind {
102- guard isPlaygroundImported , node. macroName. text == " Playground " else {
102+ guard node. macroName. text == " Playground " else {
103103 return . skipChildren
104104 }
105105
You can’t perform that action at this time.
0 commit comments