Comments (8)
Hi @andyboyd
Thanks for raising this issue. It looks like from your error message that you are not using the latest version. Can you open the companion app and check that the version number is v0.16
? If it is lower can you install the latest version and try again?
I haven't been able to reproduce this issue using v0.16
and Xcode 10 so far. Can you attach a simple project where it is reproducible if you still get the problem with v0.16
?
from swiftmockgeneratorforxcode.
I've updated to version 0.16 and I'm still seeing the same error (except now it says "Could not find a class or protocol"!)
I tried to reproduce it in a fresh project, and I did manage, but then I cleaned something up and the bug went away, and I haven't been able to reproduce it again. Our project has a ReplayKit Broadcast Upload Extension in it, and we have 2 copies of each target for live and dev builds. Only the Dev target is configured for testing.
The bug appeared when I tried to mirror that setup, but like I say, it went away when I changed something, but I'm not sure what it was I changed. Not sure if that information is helpful to you. I can't really go changing things on our real project, because it's set up the way we need it to be.
I'll investigate a bit more when I get time, unless the above info gives you a lightbulb moment!
from swiftmockgeneratorforxcode.
Thanks for the info. The error essentially means that Source Kit could not resolve any inherited types to a protocol or class and the source kit implementation is very basic in this project. Source kit is given all the files in the project directory ignoring any different targets or modules which can lead to some problems. For example, if you have two types with the same name across two different modules then source kit cannot resolve to either because it has no knowledge of those modules.
So perhaps your project was set up in such a way which didn't allow for such a simple source kit implementation. I've been working on a way to support modules and third party frameworks but it's a little way off. I'll close this for now but please reopen if the problem returns. I would be really interesting in finding out what the problem was.
from swiftmockgeneratorforxcode.
@seanhenry We are running into this issue on our end as well with Xcode 10. Not entirely sure what the cause is here, but for our target that is the host of our testing suite, we are also not getting autocomplete. I have a feeling that this may all be related to the mock generator not working as well but I haven't been able to reproduce in sample projects at all either.
from swiftmockgeneratorforxcode.
Interesting... If you're not getting autocomplete then that says to me that source kit is not working for you project for some reason. Can you try cleaning the project directory, restarting Xcode, etc and seeing if you can get autocomplete to work? The rule of thumb is if you can resolve to the declaration in Xcode with cmd+click then you should be able to generate a mock. Although there are exceptions to that rule (see above comment).
If you can cmd+click to the declaration in Xcode and the generator still gives you an error let me know and perhaps we can work through this problem to figure out a solution.
from swiftmockgeneratorforxcode.
If you're still having issues I've released a new version which might help.
If it doesn't help then I have a couple of other things to try... See my comment in issue #16
from swiftmockgeneratorforxcode.
New version works again, thanks!
from swiftmockgeneratorforxcode.
Awesome! Thanks for letting me know :)
from swiftmockgeneratorforxcode.
Related Issues (20)
- Installation? HOT 1
- Using this with Objective C HOT 1
- Typo in permission error message
- Generated code does not follow the enclosing class access control HOT 1
- Extension doesn't work on Big Sur HOT 16
- ObjectToTest ???? HOT 2
- Can't find Mock Generator on Big Sur HOT 1
- import AST errors HOT 2
- Stubs are not generated when the member variable end in a '$'
- Optional properties have a force-unwrapped stub
- Installation via Homebrew
- Stopped working under Big Sur and Xcode 12.4 HOT 1
- Extensions not supported HOT 1
- Indentation follows Xcode ctrl-i
- Naming Conventions
- Generate async mocks HOT 6
- Cannot compile because of missing private framework `SwiftToolkit`
- Optional function parameter break generator
- Handle generic completion handlers in mocked function
- Can I enter it in the function?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftmockgeneratorforxcode.