File tree Expand file tree Collapse file tree 4 files changed +7
-2
lines changed Expand file tree Collapse file tree 4 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,10 @@ static void extractDeclarations(const SwiftExtractorConfiguration& config,
134
134
for (auto decl : topLevelDecls) {
135
135
visitor.extract (decl);
136
136
}
137
- if (topLevelDecls.empty ()) {
137
+ // TODO the following will be moved to the dispatcher when we start caching swift file objects
138
+ // for the moment, topLevelDecls always contains the current module, which does not have a file
139
+ // associated with it, so we need a special case when there are no top level declarations
140
+ if (topLevelDecls.size () == 1 ) {
138
141
// In the case of empty files, the dispatcher is not called, but we still want to 'record' the
139
142
// fact that the file was extracted
140
143
llvm::SmallString<PATH_MAX> name (filename);
Original file line number Diff line number Diff line change
1
+ | empty.swift:0:0:0:0 | empty.swift | getName: | empty.swift |
1
2
| file://:0:0:0:0 | | getName: | |
2
- | hello .swift:0:0:0:0 | hello .swift | getName: | hello .swift |
3
+ | non_empty .swift:0:0:0:0 | non_empty .swift | getName: | non_empty .swift |
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ print ( " hello " )
You can’t perform that action at this time.
0 commit comments