Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
61 lines (54 sloc) 1.59 KB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>bundleUUID</key>
<string>4679484F-6227-11D9-BFB1-000D93589AF6</string>
<key>command</key>
<string>#!/usr/bin/env ruby18
require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes"
require "#{ENV['TM_SUPPORT_PATH']}/lib/escape"
require "#{ENV['TM_BUNDLE_SUPPORT']}/objc_selector_completion2"
def stripComments(line)
line.gsub(/((['"])(?:\\.|.)*?\2)|\/\*.*?\*\/|\/\/[^\n\r]*/m) do |s|
if $1
s
else
' ' * s.length()
end
end
end
def caret_position(line)
tmp = ENV['TM_LINE_NUMBER'].to_i - ENV['TM_INPUT_START_LINE'].to_i
if tmp &gt; 0
caret_placement = line.index_of_nth_occurrence_of(tmp,?\n) + ENV['TM_LINE_INDEX'].to_i
else
caret_placement =ENV['TM_LINE_INDEX'].to_i-ENV['TM_INPUT_START_LINE_INDEX'].to_i - 1
end
end
line = STDIN.read
caret_placement = caret_position(line)
res = ObjcSelectorCompletion.new(stripComments(line) , caret_placement).print
print res</string>
<key>disableOutputAutoIndent</key>
<true/>
<key>fallbackInput</key>
<string>scope</string>
<key>hideFromUser</key>
<true/>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string>~</string>
<key>name</key>
<string>Completion: Inside @selector</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
<string>meta.selector.objc</string>
<key>uuid</key>
<string>F929835A-C9F7-4934-87BD-05FD11C4435B</string>
</dict>
</plist>