-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Thrift: add struct snippet and accompanying struct field macro
git-svn-id: http://svn.textmate.org/trunk/Bundles/Thrift.tmbundle@10083 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
- Loading branch information
Showing
4 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?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>command</key> | ||
<string>#!/usr/bin/env ruby | ||
# this command is intended to be used to generate the struct field macro | ||
# the struct field macro is ^E followed by this command. | ||
i = 1 | ||
if ENV['TM_CURRENT_LINE'] =~ /^\s*(\d+):/ | ||
i = $1.to_i + 1 | ||
end | ||
puts | ||
print "${1:#{i}}${1/.+/: /m}${2:i32} ${3:field}${4/.+/ = /m}${4:value},$0" | ||
</string> | ||
<key>fallbackInput</key> | ||
<string>line</string> | ||
<key>input</key> | ||
<string>none</string> | ||
<key>name</key> | ||
<string>struct field</string> | ||
<key>output</key> | ||
<string>insertAsSnippet</string> | ||
<key>scope</key> | ||
<string>meta.struct.thrift</string> | ||
<key>uuid</key> | ||
<string>9240E318-0643-4BF7-8EBA-DD947C8CB7B9</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?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>commands</key> | ||
<array> | ||
<dict> | ||
<key>command</key> | ||
<string>moveToEndOfParagraph:</string> | ||
</dict> | ||
<dict> | ||
<key>argument</key> | ||
<dict> | ||
<key>beforeRunningCommand</key> | ||
<string>nop</string> | ||
<key>command</key> | ||
<string>#!/usr/bin/env ruby | ||
|
||
i = 1 | ||
if ENV['TM_CURRENT_LINE'] =~ /^\s*(\d+):/ | ||
i = $1.to_i + 1 | ||
end | ||
|
||
puts | ||
print "${1:#{i}}${1/.+/: /m}${2:i32} ${3:field}${4/.+/ = /m}${4:value},$0" | ||
</string> | ||
<key>fallbackInput</key> | ||
<string>line</string> | ||
<key>input</key> | ||
<string>none</string> | ||
<key>output</key> | ||
<string>insertAsSnippet</string> | ||
</dict> | ||
<key>command</key> | ||
<string>executeCommandWithOptions:</string> | ||
</dict> | ||
</array> | ||
<key>keyEquivalent</key> | ||
<string></string> | ||
<key>name</key> | ||
<string>struct field</string> | ||
<key>scope</key> | ||
<string>meta.struct.thrift</string> | ||
<key>uuid</key> | ||
<string>ED84802A-BD69-4810-9F0B-547A9DA70033</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?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>content</key> | ||
<string>struct ${1:Name} { | ||
${2:1}${2/.+/: /m}${3:i32} ${4:field}${5/.+/ = /m}${5:value},$0 | ||
}</string> | ||
<key>name</key> | ||
<string>struct</string> | ||
<key>scope</key> | ||
<string>source.thrift -meta</string> | ||
<key>tabTrigger</key> | ||
<string>str</string> | ||
<key>uuid</key> | ||
<string>FA5FBCA2-12D6-4C3B-A9A0-5B9C9AD141AD</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters