Skip to content

[CodeCompletion] Avoid suggesting duplicated module names #31892

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

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented May 19, 2020

in global completion result. Overly modules have the same name as the shadowed modules. We should not list both names because they are identical.

Maintain a set of seen module names to avoid suggesting duplicated names.

rdar://problem/63370253

@rintaro
Copy link
Member Author

rintaro commented May 19, 2020

@swift-ci Please smoke test

@rintaro rintaro requested a review from nathawes May 19, 2020 18:36
@rintaro
Copy link
Member Author

rintaro commented May 19, 2020

@swift-ci Please test Windows

Copy link
Contributor

@nathawes nathawes left a comment

Choose a reason for hiding this comment

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

LGTM!

let _: #^TYPE_GLOBAL^#
// TYPE_GLOBAL: Begin completions
// TYPE_GLOBAL-NOT: OverlayTest[#Module#]
// TYPE_GLOBAL-DAG: Decl[Module]/None: OverlayTest[#Module#];
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the -NOT above and below means this -DAG can't be reordered past them, but its not a problem if swift-ide-test is sorting the results and this is already the right order.

Copy link
Member Author

@rintaro rintaro May 19, 2020

Choose a reason for hiding this comment

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

Yeah, I think you are right. Also, swift-idea-test doesn't sort the results (but is stable). Do you know a better way to check this? Is possible, I want to avoid 2 FileCheck invocations for these checks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Outputting to a file and running file check for the negative and positive checks separately is all I can think of, sorry 🙁

in global completion result. Overly modules have the same name as the
shadowed modules. We should not list both names because they are
identical.

Maintain a set of seen module names to avoid suggesting duplicated
names.

rdar://problem/63370253
@rintaro rintaro force-pushed the ide-completion-duplicatedmodule-rdar63370253 branch from 269a0cf to af27e8f Compare May 19, 2020 22:18
@rintaro
Copy link
Member Author

rintaro commented May 19, 2020

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented May 20, 2020

@swift-ci Please smoke test macOS

@rintaro
Copy link
Member Author

rintaro commented May 20, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants