Skip to content
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

Pick best matching test file to switch to when test helpers and stubs are present #15

Merged
merged 2 commits into from
Aug 5, 2016

Conversation

csch
Copy link
Contributor

@csch csch commented Aug 5, 2016

In our codebase at work we use a lot of Stub files that have the same base filename as the source file but are located in the testing target. Depending on their order in the project, Aviator can jump to these Stub files instead of jumping to the Tests file which is annoying.

This fix introduces a ranking for names so that the best matching test file is picked:

1st match: MyClassTests.swift
2nd match: MyClassTestHelper.swift
3rd match: MyClassStub.swift

Do you think this fix is worth pulling into your repo?
Any suggestions?

@marksands marksands merged commit 890650a into marksands:master Aug 5, 2016
@marksands
Copy link
Owner

Absolutely! Great work on this, love it! 🌟 💯

@marksands
Copy link
Owner

There is another private API behind IDEKit that exposes the file hierarchy that's better suited for this problem. I have a stale branch on one of my development machines that spiked it out but I never got around to implementing it. I'm hoping extensions can handle this in Xcode 8, so we'll see!

@csch
Copy link
Contributor Author

csch commented Aug 5, 2016

Yeah, I wasn't sure if my fix was doing it "the right way" as it's my first dive into Xcode Plug-In development and I didn't want to break anything :)

Extensions and Xcode8 sounds definitely interesting!

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.

None yet

2 participants