Code Monkey home page Code Monkey logo

Comments (4)

seanhenry avatar seanhenry commented on May 23, 2024

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.

  1. Have you ever been able to generate a test double using the plugin?
  2. Do you have the latest version of the plugin installed?
  3. 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.

laurence79 avatar laurence79 commented on May 23, 2024

Hi, thanks for looking into it.

  1. No I haven't been able to generate anything yet, everything I try yields the same error.
  2. I do, v0.18.
  3. Yes I've tried that, also selecting a few characters, selecting the entire class etc.

from swiftmockgeneratorforxcode.

seanhenry avatar seanhenry commented on May 23, 2024

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.

laurence79 avatar laurence79 commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.