Skip to content

Spelling index #42543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/Index/Index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ class IndexSwiftASTWalker : public SourceEntityWalker {
/// Extensions redeclare all generic parameters of their extended type to add
/// their additional restrictions. There are two issues with this model for
/// indexing:
/// - The generic paramter declarations of the extension are implicit so we
/// - The generic parameter declarations of the extension are implicit so we
/// wouldn't report them in the index. Any usage of the generic param in
/// the extension references this implicit declaration so we don't include
/// it in the index either.
Expand All @@ -749,7 +749,7 @@ class IndexSwiftASTWalker : public SourceEntityWalker {
/// declaration of the param in the extended type.
///
/// To fix these issues, we replace the reference to the implicit generic
/// parameter defined in the extension by a reference to the generic paramter
/// parameter defined in the extension by a reference to the generic parameter
/// defined in the extended type.
///
/// \returns the canonicalized replaced generic param decl if it can be found
Expand All @@ -759,15 +759,15 @@ class IndexSwiftASTWalker : public SourceEntityWalker {
auto Extension = dyn_cast_or_null<ExtensionDecl>(
GenParam->getDeclContext()->getAsDecl());
if (!Extension) {
// We are not referencing a generic paramter defined in an extension.
// We are not referencing a generic parameter defined in an extension.
// Nothing to do.
return GenParam;
}
assert(GenParam->isImplicit() &&
"Generic param decls in extension should always be implicit and "
"shadow a generic param in the extended type.");
assert(Extension->getExtendedNominal() &&
"The implict generic types on the extension should only be created "
"The implicit generic types on the extension should only be created "
"if the extended type was found");

auto ExtendedTypeGenSig =
Expand Down Expand Up @@ -1241,8 +1241,8 @@ bool IndexSwiftASTWalker::startEntityDecl(ValueDecl *D) {
return false;
}

for (auto Overriden: collectAllOverriddenDecls(D, /*IncludeProtocolReqs=*/false)) {
addRelation(Info, (SymbolRoleSet) SymbolRole::RelationOverrideOf, Overriden);
for (auto Overridden: collectAllOverriddenDecls(D, /*IncludeProtocolReqs=*/false)) {
addRelation(Info, (SymbolRoleSet) SymbolRole::RelationOverrideOf, Overridden);
}

if (auto Parent = getParentDecl()) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Index/IndexSymbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static bool isUnitTestCase(const ClassDecl *D) {
return false;

return D->walkSuperclasses([D](ClassDecl *SuperD) {
if (SuperD != D && // Do not treate XCTestCase itself as a test.
if (SuperD != D && // Do not treat XCTestCase itself as a test.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calling this out because I tripped on it

SuperD->getNameStr() == "XCTestCase")
return TypeWalker::Action::Stop; // Found test; stop and return true.
return TypeWalker::Action::Continue;
Expand Down
2 changes: 1 addition & 1 deletion test/Index/Store/unit-custom-output-path-driver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
// INDEX_WITH_NEGATIVE-NOT: second_out.o
// INDEX_WITH_NEGATIVE-NOT: second_different.o
//
// Run with a diferent -index-unit-output-path
// Run with a different -index-unit-output-path
// RUN: echo '{ ' > %/t/outputmap-different2.json
// RUN: echo ' "%/t/main.swift":{ ' >> %/t/outputmap-different2.json
// RUN: echo ' "object": "%/t/main_different.o", ' >> %/t/outputmap-different2.json
Expand Down
2 changes: 1 addition & 1 deletion test/Index/Store/unit-custom-output-path.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
// INDEX_WITH_NEGATIVE-NOT: main_out.o
// INDEX_WITH_NEGATIVE-NOT: different.o
//
// Run with a diferent -index-unit-output-path
// Run with a different -index-unit-output-path
// RUN: %target-swift-frontend -typecheck -parse-stdlib \
// RUN: -module-name mod_name -index-store-path %t/idx_with \
// RUN: -primary-file %t/main.swift %t/second.swift \
Expand Down
2 changes: 1 addition & 1 deletion test/Index/index_generic_params.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ extension Wrapper2.NonGenericWrapped where Wrapper2Param: P1 {
func bar(x: Wrapper2Param.Assoc) {}
}

// MARK: - Test extending an unkown type
// MARK: - Test extending an unknown type

// Check that we don't crash. We don't expect the generic params to show up in the index.
extension MyUnknownType where Wrapper2Param: P1 {
Expand Down