Comments (4)
Hi @laurence79
Thanks for raising this issue. I haven't been able to reproduce your issue so far. If you help me clarify a few things I might be able to help solve your problem.
- Have you ever been able to generate a test double using the plugin?
- Do you have the latest version of the plugin installed?
- Did you have a Swift file open in Xcode and place the cursor in a class declaration? Example:
class MySpy: MyProtocol {
<cursor here>
}
from swiftmockgeneratorforxcode.
Hi, thanks for looking into it.
- No I haven't been able to generate anything yet, everything I try yields the same error.
- I do, v0.18.
- Yes I've tried that, also selecting a few characters, selecting the entire class etc.
from swiftmockgeneratorforxcode.
Thanks for the info. I've looked into the error and, you're right, it seems like selections.object(at: 0) as? XCSourceTextRange
is failing. I'm confident that the selection isn't nil which means that the cast to XCSourceTextRange
is failing. Which is strange because, according to the documentation, XCSourceTextRange
is the only possible type in the selections
array.
Assuming Xcode is only passing selections containing XCSourceTextRange
objects then the only reason for that failure that I can think of is that, for some reason, your bundle is loading two XcodeKit
frameworks or is loading a different XcodeKit
framework to Xcode and the type check is failing.*
According to my analytics, you are the only user who has seen this error so far. So I wonder if the problem is due to your environment. Could you try uninstalling the plugin, restarting your machine, reinstalling, and making sure only one Xcode is open and that xcode-select -p
points to the open version of Xcode.
It's not exactly inspiring advice for fixing a problem but I can't think of any other reasons why you would see this error.
* I've checked the rpaths of the binary and they point to directories in the bundle. There is also not a copy of XcodeKit.framework in the bundle. I also searched Xcode.app directories for the XcodeKit.framework and there seems to be only one bundled with Xcode.
from swiftmockgeneratorforxcode.
Could you try uninstalling the plugin, restarting your machine, reinstalling, and making sure only one Xcode is open and that xcode-select -p points to the open version of Xcode.
I've done this, also uninstalled Xcode completely, emptied trash, restart, reinstall, but the problem persists.
I've done an install on a separate machine and the plugin works fine, so it clearly is a problem with my environment but I'm stumped on how to figure out what exactly that problem is.
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.