Closed rudedogg closed 7 years ago
Did a little searching and found this: http://stackoverflow.com/questions/18855932/file-not-found-error-when-running-local-binary-with-popen
Changing line 18 of source_kitten.py
to "/usr/local/bin/sourcekitten"
did the trick.
Sorry for not responding sooner, I thought I had emails enabled for notifications.
I wonder why I don't get this issue... Is /usr/local/bin
in your shell $PATH variable (run echo $PATH
to check)? And do you launch Sublime Text from command line?
@Dan2552 No problem! Awesome package - it is the most promising Swift completion I've found. I'm looking forward to the improvements you have in the issue queue!
Is /usr/local/bin in your shell $PATH variable
Yes I have /usr/local/bin
in the echo $PATH
output.
And do you launch Sublime Text from command line?
No, I just use the dock. I tried it from the command line just to check - and get the FileNotFoundError: [Errno 2] No such file or directory: 'sourcekitten'
error.
Looking at the subprocess docs using Shell=True
would be a workaround and make use of my '$PATH'. But it looks like there are security issues - not sure if they're worth worrying about? Using the default homebrew path and adding a setting for using a different/custom path seems like a safe/clean option.
@rudedogg You mean changing this:
calculated_offset = _calculate_source_kitten_compatible_offset(offset, text)
to this?
calculated_offset = "/usr/local/bin/sourcekitten"
@dielsonsales the line numbers have probably changed a bit
Give this a go: https://github.com/Dan2552/SourceKittenSubl/blob/master/src/source_kitten.py#L23
- "sourcekitten",
+ "/usr/local/bin/sourcekitten",
Thanks! It's working now.
This should be resolved in https://github.com/Dan2552/SourceKittenSubl/pull/22
Hey, I have
sourcekitten
installed via homebrew, and runningsourcekitten
in a shell works.I'm getting this in the Sublime Console though:
Did I go wrong somewhere?