0

Any help with swift language code completion on coderunner, would be much appreciated. On the website https://coderunnerapp.com/ its claimed that it does support it, but not sure if I need to enable it explicitly or if I'm missing something.

nakeer
  • 641
  • 1
  • 9
  • 17

1 Answers1

0

Setup Active Directory

In Terminal run

xcrun swift --version

If you see the version information, you’re all set. If the command fails with xcrun: error: unable to find utility "swift", not a developer tool or in PATH, you need to set the active developer directory:

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

Create a Swift Template in CodeRunner

Open Preferences and switch to the Languages tab. Create a new entry in the list and name it “Swift”.

In the “Run Command:” text field, enter this command:

xcrun swift -sdk $(xcrun --show-sdk-path --sdk macosx) -i $filename

The “Code Template:” field should contain the code you want to start with when you create a blank Swift file in CodeRunner.

In the “File Extension” field, enter swift.

Community
  • 1
  • 1
Waleed
  • 69
  • 6
  • Thanks for respoding, added but getting error `xcrun: error: cannot be used within an App Sandbox.` – nakeer May 23 '20 at 23:08
  • Did you try to run it in terminal? – Waleed May 23 '20 at 23:19
  • Also make sure to specify the preferred version of Xcode when running `sudo xcode-select --switch /Applications/Xcode(Version Number).app/Contents/Developer` – Waleed May 23 '20 at 23:22
  • Yes I did run it on terminal first and it suggested me to remove -i as part of filename and I do get the version number when I run `xcrun swift --version Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15) Target: x86_64-apple-darwin18.7.0` – nakeer May 23 '20 at 23:33
  • Since you're in sandbox add a temp exception, check [this out] (https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/AppSandboxTemporaryExceptionEntitlements.html) – Waleed May 23 '20 at 23:44
  • Thank you but, not sure where to add the entitlements changes, I'm just trying to do a print("Hello") in the editor – nakeer May 24 '20 at 20:58