Skip to content

Commit 4592c0a

Browse files
author
Nathan Hawes
committed
[Index] Don't replace ' ' or '-' in group names when mapping them to a 'module' name.
The fake module names we create when indexing a Swift module divided into 'groups' (e.g. the stdlib) don't have to be valid Swift module names, but we were manipulating them to be so. E.g. the stdlib "Lazy Views" group, became "Lazy_Views". This name is displayed in some editors verbatim, and is also used as input to some sourcekitd APIs (e.g. editor.open.interface) that only work if the original group name is passed, rather than the processed one. This patch stops mapping invalid module name characters like ' ' and '-' to '_' so the original group name remains. Resolves rdar://problem/57270811
1 parent d6a6df2 commit 4592c0a

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

lib/Index/IndexRecord.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,6 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
514514
for (char ch : groupName) {
515515
if (ch == '/')
516516
buf += '.';
517-
else if (ch == ' ' || ch == '-')
518-
buf += '_';
519517
else
520518
buf += ch;
521519
}

0 commit comments

Comments
 (0)