@@ -17,17 +17,20 @@ final class SwiftIndexer: Indexer {
1717 private let graph : SynchronizedSourceGraph
1818 private let logger : ContextualLogger
1919 private let configuration : Configuration
20+ private let swiftVersion : SwiftVersion
2021
2122 required init (
2223 sourceFiles: [ SourceFile : [ IndexUnit ] ] ,
2324 graph: SynchronizedSourceGraph ,
2425 logger: ContextualLogger ,
25- configuration: Configuration
26+ configuration: Configuration ,
27+ swiftVersion: SwiftVersion
2628 ) {
2729 self . sourceFiles = sourceFiles
2830 self . graph = graph
2931 self . logger = logger. contextualized ( with: " swift " )
3032 self . configuration = configuration
33+ self . swiftVersion = swiftVersion
3134 super. init ( configuration: configuration)
3235 }
3336
@@ -39,7 +42,8 @@ final class SwiftIndexer: Indexer {
3942 retainAllDeclarations: isRetained ( file) ,
4043 graph: graph,
4144 logger: logger,
42- configuration: configuration
45+ configuration: configuration,
46+ swiftVersion: swiftVersion
4347 )
4448 }
4549
@@ -88,21 +92,24 @@ final class SwiftIndexer: Indexer {
8892 private let logger : ContextualLogger
8993 private let configuration : Configuration
9094 private var retainAllDeclarations : Bool
95+ private let swiftVersion : SwiftVersion
9196
9297 required init (
9398 sourceFile: SourceFile ,
9499 units: [ IndexUnit ] ,
95100 retainAllDeclarations: Bool ,
96101 graph: SynchronizedSourceGraph ,
97102 logger: ContextualLogger ,
98- configuration: Configuration
103+ configuration: Configuration ,
104+ swiftVersion: SwiftVersion
99105 ) {
100106 self . sourceFile = sourceFile
101107 self . units = units
102108 self . retainAllDeclarations = retainAllDeclarations
103109 self . graph = graph
104110 self . logger = logger
105111 self . configuration = configuration
112+ self . swiftVersion = swiftVersion
106113 }
107114
108115 // swiftlint:disable nesting
@@ -242,7 +249,7 @@ final class SwiftIndexer: Indexer {
242249 graph. addIndexedModules ( sourceFile. modules)
243250 }
244251
245- let multiplexingSyntaxVisitor = try MultiplexingSyntaxVisitor ( file: sourceFile)
252+ let multiplexingSyntaxVisitor = try MultiplexingSyntaxVisitor ( file: sourceFile, swiftVersion : swiftVersion )
246253 let declarationSyntaxVisitor = multiplexingSyntaxVisitor. add ( DeclarationSyntaxVisitor . self)
247254 let importSyntaxVisitor = multiplexingSyntaxVisitor. add ( ImportSyntaxVisitor . self)
248255
0 commit comments