Skip to content

Commit e977d4b

Browse files
committed
[index] Remove import.sourcefile kind from indexing
We don't support importing source files in source code, and they only showed up in the index under failure conditions.
1 parent 7366917 commit e977d4b

File tree

4 files changed

+0
-29
lines changed

4 files changed

+0
-29
lines changed

include/swift/Index/IndexSymbol.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ enum class SymbolKind {
2626

2727
Module,
2828
ClangModule, // FIXME: collapse into Module and use a separate Language field.
29-
SourceFile,
3029

3130
Enum,
3231
Struct,

lib/Index/Index.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,6 @@ bool IndexSwiftASTWalker::visitImports(
410410
for (auto File : Mod->getFiles()) {
411411
switch (File->getKind()) {
412412
case FileUnitKind::Source:
413-
assert(ImportKind == SymbolKind::Unknown &&
414-
"cannot handle multi-file modules");
415-
ImportKind = SymbolKind::SourceFile;
416-
break;
417413
case FileUnitKind::Builtin:
418414
case FileUnitKind::Derived:
419415
break;

test/SourceKit/Indexing/index_bad_modulename.swift.response

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,6 @@
77
key.filepath: Swift.swiftmodule,
88
key.hash: <hash>,
99
key.is_system: 1
10-
},
11-
{
12-
key.kind: source.lang.swift.import.sourcefile,
13-
key.name: "ObjectiveC",
14-
key.filepath: ObjectiveC.swift,
15-
key.hash: <hash>,
16-
key.dependencies: [
17-
{
18-
key.kind: source.lang.swift.import.module.swift,
19-
key.name: "Swift",
20-
key.filepath: Swift.swiftmodule,
21-
key.hash: <hash>,
22-
key.is_system: 1
23-
},
24-
{
25-
key.kind: source.lang.swift.import.module.clang,
26-
key.name: "ObjectiveC",
27-
key.filepath: ObjectiveC.pcm,
28-
key.is_system: 1
29-
}
30-
]
3110
}
3211
],
3312
key.entities: [

tools/SourceKit/lib/SwiftLang/SwiftIndexing.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,13 @@ using namespace swift::index;
3030

3131
static UIdent KindImportModuleClang("source.lang.swift.import.module.clang");
3232
static UIdent KindImportModuleSwift("source.lang.swift.import.module.swift");
33-
static UIdent KindImportSourceFile("source.lang.swift.import.sourcefile");
3433

3534
static UIdent getUIDForDependencyKind(SymbolKind depKind) {
3635
switch (depKind) {
3736
case SymbolKind::Module:
3837
return KindImportModuleSwift;
3938
case SymbolKind::ClangModule:
4039
return KindImportModuleClang;
41-
case SymbolKind::SourceFile:
42-
return KindImportSourceFile;
4340
default:
4441
return UIdent();
4542
}

0 commit comments

Comments
 (0)