textmate_import becoming quite an ugly program, but ok...

This commit is contained in:
capitaomorte 2010-04-11 09:28:21 +00:00
parent f90394827f
commit f2aaf0eeb5
2 changed files with 114 additions and 69 deletions

View File

@ -344,32 +344,32 @@
;; Translated menu ;; Translated menu
;; ;;
(yas/define-menu 'ruby-mode (yas/define-menu 'ruby-mode
'(;; Run '(;; Ignoring Run
(yas/item "35222962-C50D-4D58-A6AE-71E7AD980BE4") (yas/ignore-item "35222962-C50D-4D58-A6AE-71E7AD980BE4")
;; Run Focused Unit Test ;; Ignoring Run Focused Unit Test
(yas/item "5289EE40-86B8-11D9-A8D4-000A95E13C98") (yas/ignore-item "5289EE40-86B8-11D9-A8D4-000A95E13C98")
;; Run Rake Task ;; Ignoring Run Rake Task
(yas/item "569C9822-8C41-4907-94C7-1A8A0031B66D") (yas/ignore-item "569C9822-8C41-4907-94C7-1A8A0031B66D")
(yas/separator)
;; Documentation for Word / Selection ;; Documentation for Word / Selection
(yas/item "63F3B3B7-CBE2-426B-B551-657733F3868B") (yas/item "63F3B3B7-CBE2-426B-B551-657733F3868B")
(yas/submenu "RDoc" (yas/submenu "RDoc"
(;; Show for Current File / Project (;; Ignoring Show for Current File / Project
(yas/item "1AD6A138-2E89-4D6A-AB3F-416BF9CE968D") (yas/ignore-item "1AD6A138-2E89-4D6A-AB3F-416BF9CE968D")
(yas/separator)
(yas/submenu "Format" (yas/submenu "Format"
(;; Bold (;; Ignoring Bold
(yas/item "931DD73E-615E-476E-9B0D-8341023AE730") (yas/ignore-item "931DD73E-615E-476E-9B0D-8341023AE730")
;; Italic ;; Ignoring Italic
(yas/item "DAA69A0C-FC1E-4509-9931-DFFB38B4D6AE") (yas/ignore-item "DAA69A0C-FC1E-4509-9931-DFFB38B4D6AE")
;; Typewriter ;; Ignoring Typewriter
(yas/item "2DDB6FE0-6111-4C40-A149-8E67E76F8272"))) (yas/ignore-item "2DDB6FE0-6111-4C40-A149-8E67E76F8272")))
(yas/separator)
;; New Block ;; New Block
(yas/item "05984208-D559-4C04-A69C-2019361A985A") (yas/item "05984208-D559-4C04-A69C-2019361A985A")
;; Omit ;; Ignoring Omit
(yas/item "BF4CA9F1-51CD-48D4-8357-852234F59046") (yas/ignore-item "BF4CA9F1-51CD-48D4-8357-852234F59046")
(yas/separator)
;; :yields: ;; :yields:
(yas/item "ED6368FB-A11D-4622-9F42-7879481094F1"))) (yas/item "ED6368FB-A11D-4622-9F42-7879481094F1")))
(yas/separator) (yas/separator)
@ -384,27 +384,27 @@
(yas/item "CB81DA55-F3BC-4BFB-B0C5-29F0EE6F8081") (yas/item "CB81DA55-F3BC-4BFB-B0C5-29F0EE6F8081")
;; desc ... task :name ... end ;; desc ... task :name ... end
(yas/item "FE9A8EDA-C243-4068-8F38-A615B82D08C9") (yas/item "FE9A8EDA-C243-4068-8F38-A615B82D08C9")
;; Rake/Sake task using file path ;; Ignoring Rake/Sake task using file path
(yas/item "E07FF68B-C87D-4332-8477-D026929FDADA"))) (yas/ignore-item "E07FF68B-C87D-4332-8477-D026929FDADA")))
(yas/separator) (yas/separator)
;; Open Require ;; Ignoring Open Require
(yas/item "8646378E-91F5-4771-AC7C-43FC49A93576") (yas/ignore-item "8646378E-91F5-4771-AC7C-43FC49A93576")
;; Validate Syntax ;; Ignoring Validate Syntax
(yas/item "EE5F19BA-6C02-11D9-92BA-0011242E4184") (yas/ignore-item "EE5F19BA-6C02-11D9-92BA-0011242E4184")
(yas/separator)
;; Execute Line / Selection as Ruby ;; Ignoring Execute Line / Selection as Ruby
(yas/item "EE5F1FB2-6C02-11D9-92BA-0011242E4184") (yas/ignore-item "EE5F1FB2-6C02-11D9-92BA-0011242E4184")
;; Execute and Update # => Markers ;; Execute and Update # => Markers
(yas/item "FBFC214F-B019-4967-95D2-028F374A3221") (yas/item "FBFC214F-B019-4967-95D2-028F374A3221")
;; Add # => Marker ;; Add # => Marker
(yas/item "88BC3896-DC39-4307-A271-21D33340F15A") (yas/item "88BC3896-DC39-4307-A271-21D33340F15A")
(yas/separator) (yas/separator)
;; Insert Missing Requires ;; Ignoring Insert Missing Requires
(yas/item "9FB64639-F776-499B-BA6F-BB45F86F80FD") (yas/ignore-item "9FB64639-F776-499B-BA6F-BB45F86F80FD")
;; Add ! to Method in Line / Selection ;; Ignoring Add ! to Method in Line / Selection
(yas/item "7F79BC8D-8A4F-4570-973B-05DFEC25747F") (yas/ignore-item "7F79BC8D-8A4F-4570-973B-05DFEC25747F")
;; Toggle String / Symbol ;; Ignoring Toggle String / Symbol
(yas/item "B297E4B8-A8FF-49CE-B9C4-6D4911724D43") (yas/ignore-item "B297E4B8-A8FF-49CE-B9C4-6D4911724D43")
;; Insert ERbs <% .. %> or <%= .. %> ;; Insert ERbs <% .. %> or <%= .. %>
(yas/item "FDFABCB9-DF58-4469-AE11-5407A4FF4D70") (yas/item "FDFABCB9-DF58-4469-AE11-5407A4FF4D70")
(yas/separator) (yas/separator)
@ -439,8 +439,8 @@
(yas/item "05DFF82C-5A29-4EBD-93FE-C165FFFB5EA8") (yas/item "05DFF82C-5A29-4EBD-93FE-C165FFFB5EA8")
;; class BlankSlate .. initialize .. end ;; class BlankSlate .. initialize .. end
(yas/item "E98FB8F9-7302-431D-8BF2-275A68A6126C") (yas/item "E98FB8F9-7302-431D-8BF2-275A68A6126C")
;; class .. < DelegateClass .. initialize .. end ;; Ignoring class .. < DelegateClass .. initialize .. end
(yas/item "121B334B-2AA6-4E9A-A8B8-BF93B627982B") (yas/ignore-item "121B334B-2AA6-4E9A-A8B8-BF93B627982B")
;; class .. < DelegateClass .. initialize .. end ;; class .. < DelegateClass .. initialize .. end
(yas/item "AFE1D078-EA16-45F5-AD8A-FAC1B523D861") (yas/item "AFE1D078-EA16-45F5-AD8A-FAC1B523D861")
;; class << self .. end ;; class << self .. end
@ -453,9 +453,9 @@
;; module .. ClassMethods .. end ;; module .. ClassMethods .. end
(yas/item "A71A18CF-2D71-4BFF-AA0C-D9B8C59BC4EB"))) (yas/item "A71A18CF-2D71-4BFF-AA0C-D9B8C59BC4EB")))
(yas/submenu "Methods" (yas/submenu "Methods"
(;; New Method (;; Ignoring New Method
(yas/item "0275EF39-9357-408F-AF20-79E415CA9504") (yas/ignore-item "0275EF39-9357-408F-AF20-79E415CA9504")
(yas/separator)
;; attr_reader .. ;; attr_reader ..
(yas/item "A150C2D8-25B3-4339-BC92-8A0160A70486") (yas/item "A150C2D8-25B3-4339-BC92-8A0160A70486")
;; attr_writer .. ;; attr_writer ..
@ -468,8 +468,8 @@
;; include Comparable .. ;; include Comparable ..
(yas/item "6C9D6B3D-D8E9-4606-9534-577C8D21FFF6") (yas/item "6C9D6B3D-D8E9-4606-9534-577C8D21FFF6")
(yas/separator) (yas/separator)
;; extend Forwardable ;; Ignoring extend Forwardable
(yas/item "58FDEA60-10AF-4C49-AA09-29B77030DB25") (yas/ignore-item "58FDEA60-10AF-4C49-AA09-29B77030DB25")
;; extend Forwardable ;; extend Forwardable
(yas/item "7F46C90A-595B-4B83-A4F7-058F63CE4218") (yas/item "7F46C90A-595B-4B83-A4F7-058F63CE4218")
(yas/separator) (yas/separator)
@ -533,8 +533,8 @@
(yas/item "7E084412-80E6-4B70-8092-C03D1ECE4CD2") (yas/item "7E084412-80E6-4B70-8092-C03D1ECE4CD2")
;; each_char { |chr| .. } ;; each_char { |chr| .. }
(yas/item "FDD73070-6D32-4301-A86A-C55B77C3D8ED") (yas/item "FDD73070-6D32-4301-A86A-C55B77C3D8ED")
;; each_cons(..) { |group| .. } ;; Ignoring each_cons(..) { |group| .. }
(yas/item "EC73D5CC-5F05-46B9-A6F4-82037E4A38C9") (yas/ignore-item "EC73D5CC-5F05-46B9-A6F4-82037E4A38C9")
;; each_cons(..) { |group| .. } ;; each_cons(..) { |group| .. }
(yas/item "3C04589C-5127-478E-97B3-CA7DD2EA7ECD") (yas/item "3C04589C-5127-478E-97B3-CA7DD2EA7ECD")
;; each_index { |i| .. } ;; each_index { |i| .. }
@ -545,8 +545,8 @@
(yas/item "02913388-EE8E-4C55-AC94-94F3D751F47E") (yas/item "02913388-EE8E-4C55-AC94-94F3D751F47E")
;; each_pair { |name, val| .. } ;; each_pair { |name, val| .. }
(yas/item "7A3CECED-452B-438E-A5C6-95B6BDC43243") (yas/item "7A3CECED-452B-438E-A5C6-95B6BDC43243")
;; each_slice(..) { |group| .. } ;; Ignoring each_slice(..) { |group| .. }
(yas/item "825B721D-4367-4DF7-98C0-F005695DF9E3") (yas/ignore-item "825B721D-4367-4DF7-98C0-F005695DF9E3")
;; each_slice(..) { |group| .. } ;; each_slice(..) { |group| .. }
(yas/item "CD748479-D2A4-4AB5-95BD-4C89512BA210") (yas/item "CD748479-D2A4-4AB5-95BD-4C89512BA210")
;; each_value { |val| .. } ;; each_value { |val| .. }
@ -561,8 +561,8 @@
(yas/separator) (yas/separator)
;; map { |e| .. } ;; map { |e| .. }
(yas/item "5A3754FC-43A3-462B-AB42-E3E951872E6F") (yas/item "5A3754FC-43A3-462B-AB42-E3E951872E6F")
;; map_with_index { |e, i| .. } ;; Ignoring map_with_index { |e, i| .. }
(yas/item "BFB65D1C-62F1-485D-8A67-3E5A2E55107C") (yas/ignore-item "BFB65D1C-62F1-485D-8A67-3E5A2E55107C")
;; map_with_index { |e, i| .. } ;; map_with_index { |e, i| .. }
(yas/item "BD4CFD7B-1AC0-4569-9BDA-FD491F41F4E6"))) (yas/item "BD4CFD7B-1AC0-4569-9BDA-FD491F41F4E6")))
(yas/submenu "Files" (yas/submenu "Files"
@ -692,8 +692,8 @@
;; flunk(..) ;; flunk(..)
(yas/item "DB457094-1AC9-4856-AEFC-43A9576B6775") (yas/item "DB457094-1AC9-4856-AEFC-43A9576B6775")
(yas/separator) (yas/separator)
;; Benchmark.bmbm do .. end ;; Ignoring Benchmark.bmbm do .. end
(yas/item "C649F945-DAB8-4DA2-B73C-2EFF9D7D34F3") (yas/ignore-item "C649F945-DAB8-4DA2-B73C-2EFF9D7D34F3")
;; Benchmark.bmbm do .. end ;; Benchmark.bmbm do .. end
(yas/item "942F20E2-C40A-44B8-A3F2-99AAC68CB534") (yas/item "942F20E2-C40A-44B8-A3F2-99AAC68CB534")
;; results.report(..) { .. } ;; results.report(..) { .. }
@ -704,24 +704,24 @@
;; Marshal.load(obj) ;; Marshal.load(obj)
(yas/item "20AAD0BC-075D-4EC0-9057-E3E5E62C4125") (yas/item "20AAD0BC-075D-4EC0-9057-E3E5E62C4125")
(yas/separator) (yas/separator)
;; PStore.new( .. ) ;; Ignoring PStore.new( .. )
(yas/item "5AE7CFB4-418E-4E00-AD76-06DB755EE876") (yas/ignore-item "5AE7CFB4-418E-4E00-AD76-06DB755EE876")
;; PStore.new( .. ) ;; PStore.new( .. )
(yas/item "5B46ECFD-23A4-4F0C-9951-F64C19C72C2B") (yas/item "5B46ECFD-23A4-4F0C-9951-F64C19C72C2B")
;; transaction( .. ) { .. } ;; transaction( .. ) { .. }
(yas/item "46BF99AD-E172-4D49-BCF7-072F4730E1D9") (yas/item "46BF99AD-E172-4D49-BCF7-072F4730E1D9")
(yas/separator) (yas/separator)
;; YAML.dump(.., file) ;; Ignoring YAML.dump(.., file)
(yas/item "9460392B-C036-4A76-A5AE-1191F10E4B1B") (yas/ignore-item "9460392B-C036-4A76-A5AE-1191F10E4B1B")
;; YAML.dump(.., file) ;; YAML.dump(.., file)
(yas/item "3BA6762A-BB6B-489E-8006-F30F386AEF48") (yas/item "3BA6762A-BB6B-489E-8006-F30F386AEF48")
;; YAML.load(file) ;; Ignoring YAML.load(file)
(yas/item "2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA") (yas/ignore-item "2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA")
;; YAML.load(file) ;; YAML.load(file)
(yas/item "8343ACF4-EEB7-44B5-B835-94826466D4D5") (yas/item "8343ACF4-EEB7-44B5-B835-94826466D4D5")
(yas/separator) (yas/separator)
;; xmlread(..) ;; Ignoring xmlread(..)
(yas/item "F6BF907E-FDF7-4D9B-9E57-BE159561349D") (yas/ignore-item "F6BF907E-FDF7-4D9B-9E57-BE159561349D")
;; xmlread(..) ;; xmlread(..)
(yas/item "B904D4AA-D15D-48A4-8EB2-563BAF489332") (yas/item "B904D4AA-D15D-48A4-8EB2-563BAF489332")
;; xpath(..) { .. } ;; xpath(..) { .. }
@ -735,8 +735,8 @@
(yas/item "A4E89D97-D5ED-48BB-B5FF-1BFB79211FCD") (yas/item "A4E89D97-D5ED-48BB-B5FF-1BFB79211FCD")
;; singleton_class() ;; singleton_class()
(yas/item "B46D35B8-5DEB-4C10-A110-BA1965A2EB9C") (yas/item "B46D35B8-5DEB-4C10-A110-BA1965A2EB9C")
;; word_wrap() ;; Ignoring word_wrap()
(yas/item "97054C4D-E4A3-45B1-9C00-B82DBCB30CAD"))) (yas/ignore-item "97054C4D-E4A3-45B1-9C00-B82DBCB30CAD")))
(yas/submenu "File" (yas/submenu "File"
(;; require File.dirname(__FILE__) + "/.." (;; require File.dirname(__FILE__) + "/.."
(yas/item "7C42D878-FD0F-4181-A71A-57A091C0154A") (yas/item "7C42D878-FD0F-4181-A71A-57A091C0154A")
@ -756,7 +756,41 @@
"6519CB08-8326-4B77-A251-54722FFBFC1F" "6519CB08-8326-4B77-A251-54722FFBFC1F"
"835FAAC6-5431-436C-998B-241F7226B99B" "835FAAC6-5431-436C-998B-241F7226B99B"
"A83F68A9-F751-4BB4-AE16-56812878C16A" "A83F68A9-F751-4BB4-AE16-56812878C16A"
"47D203ED-EB9B-4653-A07B-A897800CEB76")) "47D203ED-EB9B-4653-A07B-A897800CEB76"
"35222962-C50D-4D58-A6AE-71E7AD980BE4"
"B3875596-723C-41EE-9E6F-F84930C3B568"
"8646378E-91F5-4771-AC7C-43FC49A93576"
"B297E4B8-A8FF-49CE-B9C4-6D4911724D43"
"2DDB6FE0-6111-4C40-A149-8E67E76F8272"
"569C9822-8C41-4907-94C7-1A8A0031B66D"
"835FAAC6-5431-436C-998B-241F7226B99B"
"47D203ED-EB9B-4653-A07B-A897800CEB76"
"E07FF68B-C87D-4332-8477-D026929FDADA"
"BF4CA9F1-51CD-48D4-8357-852234F59046"
"931DD73E-615E-476E-9B0D-8341023AE730"
"DAA69A0C-FC1E-4509-9931-DFFB38B4D6AE"
"825B721D-4367-4DF7-98C0-F005695DF9E3"
"121B334B-2AA6-4E9A-A8B8-BF93B627982B"
"9460392B-C036-4A76-A5AE-1191F10E4B1B"
"E5158F94-CC52-4424-A495-14EF9272653F"
"2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA"
"58FDEA60-10AF-4C49-AA09-29B77030DB25"
"EC73D5CC-5F05-46B9-A6F4-82037E4A38C9"
"BFB65D1C-62F1-485D-8A67-3E5A2E55107C"
"6519CB08-8326-4B77-A251-54722FFBFC1F"
"9FB64639-F776-499B-BA6F-BB45F86F80FD"
"5289EE40-86B8-11D9-A8D4-000A95E13C98"
"7F79BC8D-8A4F-4570-973B-05DFEC25747F"
"EE5F19BA-6C02-11D9-92BA-0011242E4184"
"EE5F1FB2-6C02-11D9-92BA-0011242E4184"
"0275EF39-9357-408F-AF20-79E415CA9504"
"1AD6A138-2E89-4D6A-AB3F-416BF9CE968D"
"97054C4D-E4A3-45B1-9C00-B82DBCB30CAD"
"76FCF165-54CB-4213-BC55-BD60B9C6A3EC"
"C649F945-DAB8-4DA2-B73C-2EFF9D7D34F3"
"5AE7CFB4-418E-4E00-AD76-06DB755EE876"
"A83F68A9-F751-4BB4-AE16-56812878C16A"
"F6BF907E-FDF7-4D9B-9E57-BE159561349D"))
;; Unknown substitutions ;; Unknown substitutions
;; ;;

View File

@ -82,6 +82,10 @@ end
# TextMate menu in terms of `yas/define-menu' # TextMate menu in terms of `yas/define-menu'
# #
class TmSubmenu class TmSubmenu
@@excluded_items = [];
def self.excluded_items; @@excluded_items; end
attr_reader :items, :name attr_reader :items, :name
def initialize(name, hash) def initialize(name, hash)
@items = hash["items"] @items = hash["items"]
@ -96,6 +100,7 @@ class TmSubmenu
first = true; first = true;
string = "" string = ""
separator_useless = true;
items.each do |uuid| items.each do |uuid|
if deleteditems.index(uuid) if deleteditems.index(uuid)
$stderr.puts "#{uuid} has been deleted!" $stderr.puts "#{uuid} has been deleted!"
@ -106,21 +111,25 @@ class TmSubmenu
string += (first ? thingy[0] : (" " * thingy[0].length)) string += (first ? thingy[0] : (" " * thingy[0].length))
submenu = allsubmenus[uuid] submenu = allsubmenus[uuid]
snippet = TmSnippet::snippets_by_uid[uuid]
unimplemented = TmSnippet::unknown_substitutions["content"][uuid]
if submenu if submenu
str = "(yas/submenu " str = "(yas/submenu "
string += str + "\"" + submenu.name + "\"" string += str + "\"" + submenu.name + "\""
string += submenu.to_lisp(allsubmenus, deleteditems, string += submenu.to_lisp(allsubmenus, deleteditems,
indent + str.length + thingy[0].length) indent + str.length + thingy[0].length)
elsif snippet = TmSnippet::snippets_by_uid[uuid] elsif snippet and not unimplemented
string += ";; " + snippet.name + "\n" string += ";; " + snippet.name + "\n"
string += " " * (indent + thingy[0].length) string += " " * (indent + thingy[0].length)
string += "(yas/item \"" + uuid + "\")" string += "(yas/item \"" + uuid + "\")"
elsif (uuid =~ /---------------------/) separator_useless = false;
string += "(yas/separator)" elsif snippet and unimplemented
else string += ";; Ignoring " + snippet.name + "\n"
string += ";; An external, misterious item\n"
string += " " * (indent + thingy[0].length) string += " " * (indent + thingy[0].length)
string += "(yas/external-item \"" + uuid + "\")" string += "(yas/ignore-item \"" + uuid + "\")"
separator_useless = true;
elsif (uuid =~ /---------------------/)
string += "(yas/separator)" unless separator_useless
end end
first = false; first = false;
end end
@ -141,8 +150,9 @@ class TmSubmenu
all[k] = TmSubmenu.new(v["name"], v) all[k] = TmSubmenu.new(v["name"], v)
end end
excluded = mainmenu["excludedItems"] + TmSubmenu::excluded_items
closing = "\n '(" closing = "\n '("
closing+= mainmenu["excludedItems"].collect do |uuid| closing+= excluded.collect do |uuid|
"\"" + uuid + "\"" "\"" + uuid + "\""
end.join( "\n ") + "))" end.join( "\n ") + "))"
@ -276,6 +286,7 @@ class TmSnippet
return ct return ct
else else
@@unknown_substitutions["content"][uuid] = self @@unknown_substitutions["content"][uuid] = self
TmSubmenu::excluded_items.push(uuid)
return "(yas/unimplemented)" return "(yas/unimplemented)"
end end
end end