Comments (9)
Hi. Thanks for raising this issue. The auto-detect feature uses Apple Script to ask Xcode which project directory is open. It sounds like this isn't working for you. Could you try a few things to help me understand what is happening?
-
Next time you see the error: "Could not detect your project. Enter one in the companion app." open Terminal and execute this command:
osascript -e 'tell application "Xcode" to path of active workspace document'
. Can you send the response that you get? -
Also when you see the error above, open the companion app. Does it show you the path to your project or does it say "Cannot find a project. Make sure a project is open in Xcode."?
-
Next time the extension takes a long time to generate a mock. Could you cancel it before it finishes and try again? It shouldn't take longer than a couple of seconds to generate a mock unless the protocol is particularly large. Xcode should say something like: 'The command "Generate Mock" is still busy' and there should be a cancel button on the right side.
-
Do you have more than one version of Xcode open or more than one project open at the same time?
from swiftmockgeneratorforxcode.
Next time I see the issue I will reply with all of this info but in the meantime some of this I can answer:
- It shows the correct path
- It actually always takes more than a few seconds to generate. We have a large repo and it is faster if I point the plugin to the directory that contains the protocol but it is still usually more than a couple seconds. We have a large internal framework included statically and also ReactiveSwift added via carthage. Not sure if this is relevant but I have noticed that if I get bored/distracted while waiting and I navigate off of the file while it is being generated it will often timeout or stall and I have to go back and generate it again.
- No only my project, no playgrounds. But as indicated above our project contains a lot.
from swiftmockgeneratorforxcode.
Thanks for the response. I think I’ve found the issue and will put out a fix soon.
Sorry to hear about the slow generation times. I intend to do some benchmarking to get better performance when I finish adding the next few features.
from swiftmockgeneratorforxcode.
No worries, our project is pretty big, I'm used to things taking a while :)
from swiftmockgeneratorforxcode.
I've uploaded the fix. The problem (I think) was that you can't run an AppleScript reliably in an XPC instance so it's now running from the extension itself. Hopefully this fixes your problem.
from swiftmockgeneratorforxcode.
I'm going to assume that fix has solved your problem. If not, feel free to open this issue again.
from swiftmockgeneratorforxcode.
Hi Sean, sorry for the delay. I will confirm for you on Monday!
from swiftmockgeneratorforxcode.
Everything is working great, thanks again Sean!
from swiftmockgeneratorforxcode.
Great!
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.