]> gitweb.factorcode.org Git - factor.git/commitdiff
textmate bundle work- stopped by modules bug
authorSam Anklesaria <sam@Tintin.local>
Mon, 3 Aug 2009 15:12:20 +0000 (10:12 -0500)
committerSam Anklesaria <sam@Tintin.local>
Mon, 3 Aug 2009 15:12:20 +0000 (10:12 -0500)
29 files changed:
basis/editors/textmate/textmate.factor
extra/modules/rpc-server/rpc-server.factor
extra/modules/using/using-docs.factor
extra/modules/using/using.factor
misc/Factor.tmbundle/Commands/Cycle Vocabs:Docs:Tests.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Edit Word Docs.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Edit.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Expand Selection.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Fix.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Help for Word.tmCommand
misc/Factor.tmbundle/Commands/Infer Effect of Selection.tmCommand [deleted file]
misc/Factor.tmbundle/Commands/Infer Selection.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Insert Inferrence.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Profile.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Reload.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Reset.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Scaffold.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/See Word.tmCommand
misc/Factor.tmbundle/Commands/Set Breakpoint.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Show Using.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Usage.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Vocab Usage.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Vocab Uses.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Walk Selection.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Commands/Watch.tmCommand [new file with mode: 0644]
misc/Factor.tmbundle/Macros/Extract as New Word.tmMacro [new file with mode: 0644]
misc/Factor.tmbundle/Support/lib/do_scaffold.rb [new file with mode: 0644]
misc/Factor.tmbundle/Support/lib/tm_factor.rb
misc/Factor.tmbundle/info.plist

index 65395bd590d5eb9c60a2b3434e441d6979bf4971..72af2ba030ab028cfed6f9c9a6656f3fc071edf5 100644 (file)
@@ -1,5 +1,5 @@
 USING: definitions io.launcher kernel math math.parser parser
-namespaces prettyprint editors make ;
+namespaces prettyprint editors make vocabs.loader ;
 IN: editors.textmate
 
 : textmate ( file line -- )
@@ -7,3 +7,4 @@ IN: editors.textmate
     run-detached drop ;
 
 [ textmate ] edit-hook set-global
+"get-using" require
index cb7e652a39d75a03b544a864bf897a5372dfbe65..7ac50ab61fd62afffdd4a28671fb10aea1b23f93 100644 (file)
@@ -32,4 +32,4 @@ SYNTAX: service current-vocab name>> serving-vocabs get-global adjoin ;
     register-gets-thread
     register-does-thread
     register-loads-thread
-] "start-serving-vocabs" add-init-hook
\ No newline at end of file
+] "modules.rpc-server" add-init-hook
\ No newline at end of file
index cfc0687944ce0801acee6c7ed126b734fda7011e..f3c25f920134431f3f7cb35beddf0c54bf4d7c25 100644 (file)
@@ -6,7 +6,6 @@ ARTICLE: { "modules.using" "use" } "Using the modules.using vocab"
 "Finally, the word can treat words in remote vocabularies as remote procedure calls. Any inputs are passed to the imported words as normal, and the result will appear on the stack- the only difference is that the word isn't called locally." ;
 ABOUT: { "modules.using" "use" }
 
-IN: syntax
 HELP: USING*:
 { $syntax "USING: rpc-server::module fetch-sever:module { module qualified-name } { module => word ... } { qualified-module } { module EXCEPT word ... } { module word => importname } ;" }
 { $description "Adds vocabularies to the search path. Vocabularies can be loaded off a server or called as an rpc if preceded by a valid hostname. Bracketed pairs facilitate all types of qualified imports on both remote and local modules." }
index 5a13f585876e43b44f0b457f248724e670f2466f..5691caaf6a46c28b13804fbe1b3bc8936081d931 100644 (file)
@@ -12,7 +12,6 @@ remote = tokenpart s tokenpart => [[ first2 remote-load ]]
 module = rpc | remote | tokenpart
 ;EBNF
 
-IN: syntax
 ON-BNF: USING*:
 tokenizer = <foreign factor>
 sym = !(";"|"}"|"=>"|"EXCEPT").
diff --git a/misc/Factor.tmbundle/Commands/Cycle Vocabs:Docs:Tests.tmCommand b/misc/Factor.tmbundle/Commands/Cycle Vocabs:Docs:Tests.tmCommand
new file mode 100644 (file)
index 0000000..8c4ec63
--- /dev/null
@@ -0,0 +1,32 @@
+<?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>8061D2F3-B603-411D-AFFE-61784A07906D</string>
+       <key>command</key>
+       <string>#! /Applications/factor/factor
+
+"TM_FILEPATH" os-env [ parent-directory ] [ file-name dup ] bi {
+{ [ dup "docs.factor" tail? ] [ drop 11 tail* "tests.factor" append append ] }
+{ [ "-tests.factor" tail? ] [ 13 tail* ".factor" append append ] }
+[ 7 tail* [ "-docs.factor" append append ] keep over exists? [ drop ] [ scaffold-help ] if ]
+} cond 0 textmate</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>none</string>
+       <key>keyEquivalent</key>
+       <string>^@      </string>
+       <key>name</key>
+       <string>Cycle Vocabs/Docs/Tests</string>
+       <key>output</key>
+       <string>discard</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>D348BE40-6F51-4471-B300-DDDA70ED8C8C</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Edit Word Docs.tmCommand b/misc/Factor.tmbundle/Commands/Edit Word Docs.tmCommand
new file mode 100644 (file)
index 0000000..bc447ee
--- /dev/null
@@ -0,0 +1,32 @@
+<?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>8061D2F3-B603-411D-AFFE-61784A07906D</string>
+       <key>command</key>
+       <string>#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+doc = STDIN.read
+word = line_current_word(ENV["TM_CURRENT_LINE"], ENV["TM_LINE_INDEX"].to_i)
+puts factor_eval(%Q(#{doc_using_statements(doc)} USING: help.topics editors ;\n \\ #{word} &gt;link edit))</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>document</string>
+       <key>keyEquivalent</key>
+       <string>@D</string>
+       <key>name</key>
+       <string>Edit Word Docs</string>
+       <key>output</key>
+       <string>discard</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>D95A617C-E1C6-44DA-9126-04171CB21299</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Edit.tmCommand b/misc/Factor.tmbundle/Commands/Edit.tmCommand
new file mode 100644 (file)
index 0000000..4f077c4
--- /dev/null
@@ -0,0 +1,32 @@
+<?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>8061D2F3-B603-411D-AFFE-61784A07906D</string>
+       <key>command</key>
+       <string>#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+doc = STDIN.read
+word = line_current_word(ENV["TM_CURRENT_LINE"], ENV["TM_LINE_INDEX"].to_i)
+puts factor_eval(%Q(#{doc_using_statements(doc)} USE: editors\n \\ #{word} edit))</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>document</string>
+       <key>keyEquivalent</key>
+       <string>@E</string>
+       <key>name</key>
+       <string>Edit</string>
+       <key>output</key>
+       <string>discard</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>C573487C-DD7D-497F-A728-52D7962D95E2</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Expand Selection.tmCommand b/misc/Factor.tmbundle/Commands/Expand Selection.tmCommand
new file mode 100644 (file)
index 0000000..d2b69dc
--- /dev/null
@@ -0,0 +1,29 @@
+<?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>8061D2F3-B603-411D-AFFE-61784A07906D</string>
+       <key>command</key>
+       <string>#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+doc = STDIN.read
+puts factor_eval(%Q(#{doc_using_statements(doc)} USE: ui.tools.operations\n [ #{ENV["TM_SELECTED_TEXT"} ] com-expand-macros))</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>document</string>
+       <key>name</key>
+       <string>Expand Selection</string>
+       <key>output</key>
+       <string>showAsTooltip</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>8465B33D-7CA0-4337-945C-4078346D64BC</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Fix.tmCommand b/misc/Factor.tmbundle/Commands/Fix.tmCommand
new file mode 100644 (file)
index 0000000..a49f8a4
--- /dev/null
@@ -0,0 +1,32 @@
+<?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>8061D2F3-B603-411D-AFFE-61784A07906D</string>
+       <key>command</key>
+       <string>#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+doc = STDIN.read
+word = line_current_word(ENV["TM_CURRENT_LINE"], ENV["TM_LINE_INDEX"].to_i)
+puts factor_run(%Q(#{doc_using_statements(doc)} USE: editors\n \\ #{word} fix))</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>document</string>
+       <key>keyEquivalent</key>
+       <string>@F</string>
+       <key>name</key>
+       <string>Fix</string>
+       <key>output</key>
+       <string>discard</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>D02D9D74-E073-48AE-A78E-B40FFFA519D5</string>
+</dict>
+</plist>
index 0ff133c891705991c40ba14f370c397f03260c0f..350c01d3442c0a9a2aebcb61d8877a5691d6bf19 100644 (file)
@@ -11,7 +11,7 @@ require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
 
 doc = STDIN.read
 word = line_current_word(ENV["TM_CURRENT_LINE"], ENV["TM_LINE_INDEX"].to_i)
-factor_run(%Q(#{doc_using_statements(doc)} USE: ui.tools.workspace\n \\ #{word} help-window))</string>
+factor_run(%Q(#{doc_using_statements(doc)} USE: help\n \\ #{word} help))</string>
        <key>fallbackInput</key>
        <string>word</string>
        <key>input</key>
diff --git a/misc/Factor.tmbundle/Commands/Infer Effect of Selection.tmCommand b/misc/Factor.tmbundle/Commands/Infer Effect of Selection.tmCommand
deleted file mode 100644 (file)
index 378294e..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?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
-
-require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
-
-doc = STDIN.read
-puts factor_eval(%Q(#{doc_using_statements(doc)} USE: inference\n [ #{ENV["TM_SELECTED_TEXT"]} ] infer.))</string>
-       <key>fallbackInput</key>
-       <string>word</string>
-       <key>input</key>
-       <string>document</string>
-       <key>name</key>
-       <string>Infer Effect of Selection</string>
-       <key>output</key>
-       <string>showAsTooltip</string>
-       <key>scope</key>
-       <string>source.factor</string>
-       <key>uuid</key>
-       <string>B619FCC0-2DF2-4657-82A8-0E5676A10254</string>
-</dict>
-</plist>
diff --git a/misc/Factor.tmbundle/Commands/Infer Selection.tmCommand b/misc/Factor.tmbundle/Commands/Infer Selection.tmCommand
new file mode 100644 (file)
index 0000000..c7b6ec8
--- /dev/null
@@ -0,0 +1,29 @@
+<?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
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+doc = STDIN.read
+puts factor_eval(%Q(#{doc_using_statements(doc)} USE: stack-checker\n [ #{ENV["TM_SELECTED_TEXT"]} ] infer.))</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>document</string>
+       <key>keyEquivalent</key>
+       <string>^i</string>
+       <key>name</key>
+       <string>Infer Selection</string>
+       <key>output</key>
+       <string>showAsTooltip</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>B619FCC0-2DF2-4657-82A8-0E5676A10254</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Insert Inferrence.tmCommand b/misc/Factor.tmbundle/Commands/Insert Inferrence.tmCommand
new file mode 100644 (file)
index 0000000..366cdfc
--- /dev/null
@@ -0,0 +1,27 @@
+<?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
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+doc = STDIN.read
+puts factor_eval(%Q(#{doc_using_statements(doc)} USE: stack-checker\n [ #{ENV["TM_SELECTED_TEXT"]} ] infer.))</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>document</string>
+       <key>name</key>
+       <string>Insert Inferrence</string>
+       <key>output</key>
+       <string>afterSelectedText</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>DBC0A0CA-5368-43A7-864B-7B9C4034AD08</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Profile.tmCommand b/misc/Factor.tmbundle/Commands/Profile.tmCommand
new file mode 100644 (file)
index 0000000..108ad7b
--- /dev/null
@@ -0,0 +1,32 @@
+<?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>8061D2F3-B603-411D-AFFE-61784A07906D</string>
+       <key>command</key>
+       <string>#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+doc = STDIN.read
+word = line_current_word(ENV["TM_CURRENT_LINE"], ENV["TM_LINE_INDEX"].to_i)
+puts factor_run(%Q(#{doc_using_statements(doc)} USE: tools.profiler\n [ #{word} ] profile))</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>document</string>
+       <key>keyEquivalent</key>
+       <string>^p</string>
+       <key>name</key>
+       <string>Profile</string>
+       <key>output</key>
+       <string>discard</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>7FF52332-CA5B-4D46-99EF-DAE0659DB478</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Reload.tmCommand b/misc/Factor.tmbundle/Commands/Reload.tmCommand
new file mode 100644 (file)
index 0000000..1dcd350
--- /dev/null
@@ -0,0 +1,26 @@
+<?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
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+doc = STDIN.read
+factor_run(%Q(USE: vocabs.loader\n "#{doc[/\bIN:\s(\S+)/, 1]}" reload))</string>
+       <key>input</key>
+       <string>document</string>
+       <key>keyEquivalent</key>
+       <string>^r</string>
+       <key>name</key>
+       <string>Reload</string>
+       <key>output</key>
+       <string>discard</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>8088D204-FFD7-4384-8FDD-A01536FFD0E7</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Reset.tmCommand b/misc/Factor.tmbundle/Commands/Reset.tmCommand
new file mode 100644 (file)
index 0000000..ae15b9d
--- /dev/null
@@ -0,0 +1,32 @@
+<?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>8061D2F3-B603-411D-AFFE-61784A07906D</string>
+       <key>command</key>
+       <string>#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+doc = STDIN.read
+word = line_current_word(ENV["TM_CURRENT_LINE"], ENV["TM_LINE_INDEX"].to_i)
+puts factor_eval(%Q(#{doc_using_statements(doc)} USE: tools.annotations\n \\ #{word} reset))</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>document</string>
+       <key>keyEquivalent</key>
+       <string>^~r</string>
+       <key>name</key>
+       <string>Reset</string>
+       <key>output</key>
+       <string>discard</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>71F08D9B-3D24-4E78-84C9-82CA736554D1</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Scaffold.tmCommand b/misc/Factor.tmbundle/Commands/Scaffold.tmCommand
new file mode 100644 (file)
index 0000000..fe19572
--- /dev/null
@@ -0,0 +1,32 @@
+<?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>8061D2F3-B603-411D-AFFE-61784A07906D</string>
+       <key>command</key>
+       <string>res=$(CocoaDialog inputbox --title "Scaffold Setup" \
+    --informative-text "Vocab Name:" \
+    --button1 "Okay" --button2 "Cancel")
+
+[[ $(head -n1 &lt;&lt;&lt;"$res") == "2" ]] &amp;&amp; exit_discard
+res=$(tail -n1 &lt;&lt;&lt;"$res")
+"$TM_BUNDLE_SUPPORT/lib/do_scaffolding.rb" res</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>none</string>
+       <key>keyEquivalent</key>
+       <string>@N</string>
+       <key>name</key>
+       <string>Scaffold</string>
+       <key>output</key>
+       <string>discard</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>0CDA009F-8518-4C45-AB0E-D11B281131BF</string>
+</dict>
+</plist>
index 4502e235be0b2eaf6a9c30bf9173181025ac69dc..ca1cf4232044f926cbf461a6d51cd87a5c8ad1a0 100644 (file)
@@ -11,7 +11,7 @@ require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
 
 doc = STDIN.read
 word = line_current_word(ENV["TM_CURRENT_LINE"], ENV["TM_LINE_INDEX"].to_i)
-puts factor_eval(%Q(#{doc_using_statements(doc)} USE: prettyprint\n \\ #{word} see))</string>
+puts factor_eval(%Q(#{doc_using_statements(doc)} USE: see\n \\ #{word} see))</string>
        <key>fallbackInput</key>
        <string>word</string>
        <key>input</key>
diff --git a/misc/Factor.tmbundle/Commands/Set Breakpoint.tmCommand b/misc/Factor.tmbundle/Commands/Set Breakpoint.tmCommand
new file mode 100644 (file)
index 0000000..1066c78
--- /dev/null
@@ -0,0 +1,32 @@
+<?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>8061D2F3-B603-411D-AFFE-61784A07906D</string>
+       <key>command</key>
+       <string>#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+doc = STDIN.read
+word = line_current_word(ENV["TM_CURRENT_LINE"], ENV["TM_LINE_INDEX"].to_i)
+puts factor_eval(%Q(#{doc_using_statements(doc)} USE: tools.annotations\n \\ #{word} breakpoint))</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>document</string>
+       <key>keyEquivalent</key>
+       <string>^b</string>
+       <key>name</key>
+       <string>Set Breakpoint</string>
+       <key>output</key>
+       <string>discard</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>E4614756-DF2E-433A-8935-197159C67AB8</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Show Using.tmCommand b/misc/Factor.tmbundle/Commands/Show Using.tmCommand
new file mode 100644 (file)
index 0000000..22681bd
--- /dev/null
@@ -0,0 +1,27 @@
+<?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>#! /Applications/factor/factor
+USE: modules.using
+USING*: environment localhost::get-using io ;
+"TM_FILEPATH" os-env get-using write</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>none</string>
+       <key>keyEquivalent</key>
+       <string>^u</string>
+       <key>name</key>
+       <string>Show Using</string>
+       <key>output</key>
+       <string>showAsTooltip</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>86DD4385-4029-4EFE-B546-1EC8EB5EB932</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Usage.tmCommand b/misc/Factor.tmbundle/Commands/Usage.tmCommand
new file mode 100644 (file)
index 0000000..459a7fe
--- /dev/null
@@ -0,0 +1,30 @@
+<?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>8061D2F3-B603-411D-AFFE-61784A07906D</string>
+       <key>command</key>
+       <string>#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+doc = STDIN.read
+word = line_current_word(ENV["TM_CURRENT_LINE"], ENV["TM_LINE_INDEX"].to_i)
+puts factor_eval(%Q(#{doc_using_statements(doc)} USE: tools.crossref\n \\ #{word} usage.))</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>document</string>
+       <key>name</key>
+       <string>Usage</string>
+       <key>output</key>
+       <string>showAsTooltip</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>3043A033-A113-4283-BCBB-3DE2CCC8F63E</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Vocab Usage.tmCommand b/misc/Factor.tmbundle/Commands/Vocab Usage.tmCommand
new file mode 100644 (file)
index 0000000..70687d9
--- /dev/null
@@ -0,0 +1,29 @@
+<?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>8061D2F3-B603-411D-AFFE-61784A07906D</string>
+       <key>command</key>
+       <string>#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+word = line_current_word(ENV["TM_CURRENT_LINE"], ENV["TM_LINE_INDEX"].to_i)
+puts factor_eval(%Q(USE: tools.crossref\n "#{word}" vocab-usage.))</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>none</string>
+       <key>name</key>
+       <string>Vocab Usage</string>
+       <key>output</key>
+       <string>showAsTooltip</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>B1F81321-B760-474F-875D-78FB52752E1B</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Vocab Uses.tmCommand b/misc/Factor.tmbundle/Commands/Vocab Uses.tmCommand
new file mode 100644 (file)
index 0000000..e8acb98
--- /dev/null
@@ -0,0 +1,29 @@
+<?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>8061D2F3-B603-411D-AFFE-61784A07906D</string>
+       <key>command</key>
+       <string>#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+word = line_current_word(ENV["TM_CURRENT_LINE"], ENV["TM_LINE_INDEX"].to_i)
+puts factor_eval(%Q(USE: tools.crossref\n "#{word}" vocab-uses.))</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>none</string>
+       <key>name</key>
+       <string>Vocab Uses</string>
+       <key>output</key>
+       <string>showAsTooltip</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>BC3E2E39-3B79-460C-B05E-BD00BAACB90E</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Walk Selection.tmCommand b/misc/Factor.tmbundle/Commands/Walk Selection.tmCommand
new file mode 100644 (file)
index 0000000..641e6db
--- /dev/null
@@ -0,0 +1,31 @@
+<?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>8061D2F3-B603-411D-AFFE-61784A07906D</string>
+       <key>command</key>
+       <string>#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+doc = STDIN.read
+puts factor_run(%Q(#{doc_using_statements(doc)} USE: tools.walker\n [ #{ENV["TM_SELECTED_TEXT"]} ] walk))</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>document</string>
+       <key>keyEquivalent</key>
+       <string>^w</string>
+       <key>name</key>
+       <string>Walk Selection</string>
+       <key>output</key>
+       <string>discard</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>57C2BAAC-0474-404F-AA91-DFD02EC2A3ED</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Watch.tmCommand b/misc/Factor.tmbundle/Commands/Watch.tmCommand
new file mode 100644 (file)
index 0000000..e2c9501
--- /dev/null
@@ -0,0 +1,32 @@
+<?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>8061D2F3-B603-411D-AFFE-61784A07906D</string>
+       <key>command</key>
+       <string>#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+doc = STDIN.read
+word = line_current_word(ENV["TM_CURRENT_LINE"], ENV["TM_LINE_INDEX"].to_i)
+puts factor_eval(%Q(#{doc_using_statements(doc)} USE: tools.annotations\n \\ #{word} watch))</string>
+       <key>fallbackInput</key>
+       <string>word</string>
+       <key>input</key>
+       <string>document</string>
+       <key>keyEquivalent</key>
+       <string>^~w</string>
+       <key>name</key>
+       <string>Watch</string>
+       <key>output</key>
+       <string>discard</string>
+       <key>scope</key>
+       <string>source.factor</string>
+       <key>uuid</key>
+       <string>1C86869F-1030-4F74-B242-6357A080E127</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Macros/Extract as New Word.tmMacro b/misc/Factor.tmbundle/Macros/Extract as New Word.tmMacro
new file mode 100644 (file)
index 0000000..537a5ac
--- /dev/null
@@ -0,0 +1,239 @@
+<?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>cut:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>m</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>y</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>-</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>w</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>o</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>r</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>d</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <dict>
+                               <key>action</key>
+                               <string>findPrevious</string>
+                               <key>findInProjectIgnoreCase</key>
+                               <true/>
+                               <key>findString</key>
+                               <string>: </string>
+                               <key>ignoreCase</key>
+                               <true/>
+                               <key>replaceAllScope</key>
+                               <string>document</string>
+                               <key>replaceString</key>
+                               <string>table</string>
+                               <key>wrapAround</key>
+                               <true/>
+                       </dict>
+                       <key>command</key>
+                       <string>findWithOptions:</string>
+               </dict>
+               <dict>
+                       <key>command</key>
+                       <string>moveToBeginningOfLine:</string>
+               </dict>
+               <dict>
+                       <key>command</key>
+                       <string>paste:</string>
+               </dict>
+               <dict>
+                       <key>command</key>
+                       <string>moveToBeginningOfLineAndModifySelection:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <dict>
+                               <key>beforeRunningCommand</key>
+                               <string>nop</string>
+                               <key>command</key>
+                               <string>#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+doc = STDIN.read
+puts factor_eval(%Q(#{doc_using_statements(doc)} USE: stack-checker\n [ #{ENV["TM_SELECTED_TEXT"]} ] infer.))</string>
+                               <key>fallbackInput</key>
+                               <string>word</string>
+                               <key>input</key>
+                               <string>document</string>
+                               <key>name</key>
+                               <string>Insert Inferrence</string>
+                               <key>output</key>
+                               <string>afterSelectedText</string>
+                               <key>scope</key>
+                               <string>source.factor</string>
+                               <key>uuid</key>
+                               <string>DBC0A0CA-5368-43A7-864B-7B9C4034AD08</string>
+                       </dict>
+                       <key>command</key>
+                       <string>executeCommandWithOptions:</string>
+               </dict>
+               <dict>
+                       <key>command</key>
+                       <string>insertNewline:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <dict>
+                               <key>action</key>
+                               <string>findPrevious</string>
+                               <key>findInProjectIgnoreCase</key>
+                               <true/>
+                               <key>findString</key>
+                               <string>(</string>
+                               <key>ignoreCase</key>
+                               <true/>
+                               <key>replaceAllScope</key>
+                               <string>document</string>
+                               <key>replaceString</key>
+                               <string>table</string>
+                               <key>wrapAround</key>
+                               <true/>
+                       </dict>
+                       <key>command</key>
+                       <string>findWithOptions:</string>
+               </dict>
+               <dict>
+                       <key>command</key>
+                       <string>moveToEndOfLineAndModifySelection:</string>
+               </dict>
+               <dict>
+                       <key>command</key>
+                       <string>cut:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string> </string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>;</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>command</key>
+                       <string>moveToBeginningOfLine:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>:</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string> </string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>m</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>y</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>-</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>w</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>o</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>r</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string>d</string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string> </string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+               <dict>
+                       <key>command</key>
+                       <string>paste:</string>
+               </dict>
+               <dict>
+                       <key>argument</key>
+                       <string> </string>
+                       <key>command</key>
+                       <string>insertText:</string>
+               </dict>
+       </array>
+       <key>name</key>
+       <string>Extract as New Word</string>
+       <key>uuid</key>
+       <string>82E740D1-8D20-48AF-8470-C85C251D4870</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Support/lib/do_scaffold.rb b/misc/Factor.tmbundle/Support/lib/do_scaffold.rb
new file mode 100644 (file)
index 0000000..a0cc2bf
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+
+path = ENV["TM_FILEPATH"]
+if path.include?("factor/work") then
+  s = "scaffold-work"
+elsif path.include?("factor/basis") then
+  s = "scaffold-basis"
+elsif path.include?("factor/core") then
+  s = "scaffold-core"
+else
+  s = "scaffold-extra"
+end
+
+puts factor_eval(%Q(USE: tools.scaffold\n "#{ARGV.first}" #{s}))
\ No newline at end of file
index 2775a12ae9f621af1272a8a5bad41c186c4b1bbb..48f318651a4508fc4bddc7d6557b032408e539c2 100644 (file)
@@ -32,6 +32,10 @@ def doc_using_statements(document)
     document.scan(/\b(USING:\s[^;]*\s;|USE:\s+\S+|IN:\s\S+)/).join("\n") << "\n"
 end
 
+def doc_vocab(document) 
+  document.sub(/\bIN:\s(\S+)/, %Q("\\1"))
+end
+
 def line_current_word(line, point)
     left = line.rindex(/\s/, point - 1) || 0; right = line.index(/\s/, point) || line.length
     line[left..right]
index 1ea756a1a5855affdbcfe6355d4ab3625955cb3a..19d58def86d8e91a2deef5af5920b2b7ee2a3195 100644 (file)
@@ -2,18 +2,40 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
+       <key>deleted</key>
+       <array>
+               <string>4D090AD9-76F9-4A0B-B3F2-7428B7C15FBA</string>
+       </array>
        <key>name</key>
        <string>Factor</string>
        <key>ordering</key>
        <array>
+               <string>82E740D1-8D20-48AF-8470-C85C251D4870</string>
                <string>3C9C9C2A-314A-475B-A4E4-A68BAAF3F36E</string>
                <string>141517D7-73E0-4475-A481-71102575A175</string>
                <string>CAD3BB10-C480-4C0E-9518-94D61F7A0C0B</string>
+               <string>8088D204-FFD7-4384-8FDD-A01536FFD0E7</string>
                <string>15A984BD-BC65-43E8-878A-267788C8DA70</string>
                <string>8E01DDAF-959B-4237-ADB9-C133A4ACCE90</string>
                <string>35484754-DBF9-4381-BB25-00CAB64DF4A1</string>
                <string>BC5BE120-734B-40DF-8B6B-5D3243614B27</string>
                <string>B619FCC0-2DF2-4657-82A8-0E5676A10254</string>
+               <string>DBC0A0CA-5368-43A7-864B-7B9C4034AD08</string>
+               <string>86DD4385-4029-4EFE-B546-1EC8EB5EB932</string>
+               <string>3043A033-A113-4283-BCBB-3DE2CCC8F63E</string>
+               <string>B1F81321-B760-474F-875D-78FB52752E1B</string>
+               <string>BC3E2E39-3B79-460C-B05E-BD00BAACB90E</string>
+               <string>8465B33D-7CA0-4337-945C-4078346D64BC</string>
+               <string>57C2BAAC-0474-404F-AA91-DFD02EC2A3ED</string>
+               <string>E4614756-DF2E-433A-8935-197159C67AB8</string>
+               <string>1C86869F-1030-4F74-B242-6357A080E127</string>
+               <string>D02D9D74-E073-48AE-A78E-B40FFFA519D5</string>
+               <string>C573487C-DD7D-497F-A728-52D7962D95E2</string>
+               <string>D95A617C-E1C6-44DA-9126-04171CB21299</string>
+               <string>71F08D9B-3D24-4E78-84C9-82CA736554D1</string>
+               <string>7FF52332-CA5B-4D46-99EF-DAE0659DB478</string>
+               <string>0CDA009F-8518-4C45-AB0E-D11B281131BF</string>
+               <string>D348BE40-6F51-4471-B300-DDDA70ED8C8C</string>
        </array>
        <key>uuid</key>
        <string>8061D2F3-B603-411D-AFFE-61784A07906D</string>