<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>Alright then.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I have some stuff done.</DIV><DIV>Update you support folder and Experimental bundle.</DIV><DIV>Enjoy CodeCompletion goodness.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Only have a CodeCompletions list for Ruby sofar, and that probly needs to be recreated.</DIV><DIV>But the library is pretty hip.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>If you want to start creating static completion lists, please do.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><B>How to use this version</B></DIV><DIV><SPAN class="Apple-style-span">Create a tmCommand, <B>input</B>: selection or line, <B>output</B>: insert as snippet, <B>contents like this</B>:</SPAN></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><FONT class="Apple-style-span" color="#00000000" face="Courier" size="2"><SPAN class="Apple-style-span" style="background-color: transparent; font-size: 10px;">#!/usr/bin/env ruby</SPAN></FONT></DIV><DIV><FONT class="Apple-style-span" color="#00000000" face="Courier" size="2"><SPAN class="Apple-style-span" style="background-color: transparent; font-size: 10px;">require "#{ENV['TM_SUPPORT_PATH']}/lib/codecompletion"</SPAN></FONT></DIV><DIV><FONT class="Apple-style-span" color="#00000000" face="Courier" size="2"><SPAN class="Apple-style-span" style="background-color: transparent; font-size: 10px;">TextmateCodeCompletion.simple</SPAN></FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>By default, it'll look for a tmPreference in that bundle with the name "CodeCompletions".</DIV><DIV><B>That preference should be like this:</B></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><FONT class="Apple-style-span" color="#000000" face="Courier" size="2"><SPAN class="Apple-style-span" style="background-color: transparent; font-size: 10px;">{</SPAN></FONT><SPAN class="Apple-tab-span" style="white-space:pre">  </SPAN><FONT class="Apple-style-span" color="#000000" face="Courier" size="2"><SPAN class="Apple-style-span" style="background-color: transparent; font-size: 10px;">completions = ( 'fibbity', 'flabbity', 'floo' ); }</SPAN></FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Where the completions is an array of strings.</DIV><DIV><B>You can overwrite that by passing in a different name for the preference like this:</B></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><FONT class="Apple-style-span" color="#000000" face="Courier" size="2"><SPAN class="Apple-style-span" style="background-color: transparent; font-size: 10px;">TextmateCodeCompletion.simple('SomeOtherNameForMyCompletions')</SPAN></FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><B>Or you can use any random plist file like this:</B></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><FONT class="Apple-style-span" color="#000000" face="Courier" size="2"><SPAN class="Apple-style-span" style="background-color: transparent; font-size: 10px;">#!/usr/bin/env ruby</SPAN></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000" face="Courier" size="2"><SPAN class="Apple-style-span" style="background-color: transparent; font-size: 10px;">require "#{ENV['TM_SUPPORT_PATH']}/lib/codecompletion"</SPAN></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000" face="Courier" size="2"><SPAN class="Apple-style-span" style="background-color: transparent; font-size: 10px;">choices = TextmateCompletionsPlist.new('path_to_my_plist_file_of_doom').to_ary</SPAN></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000" face="Courier" size="2"><SPAN class="Apple-style-span" style="background-color: transparent; font-size: 10px;">print TextmateCodeCompletion.new(choices,STDIN.read).to_s</SPAN></FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><B>Or you can just pass in an array manually like so:</B></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><FONT class="Apple-style-span" color="#000000" face="Courier" size="2"><SPAN class="Apple-style-span" style="background-color: transparent; font-size: 10px;">#!/usr/bin/env ruby</SPAN></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000" face="Courier" size="2"><SPAN class="Apple-style-span" style="background-color: transparent; font-size: 10px;">require "#{ENV['TM_SUPPORT_PATH']}/lib/codecompletion"</SPAN></FONT></DIV><DIV><FONT class="Apple-style-span" color="#000000" face="Courier" size="2"><SPAN class="Apple-style-span" style="background-color: transparent; font-size: 10px;">print TextmateCodeCompletion.new([ 'fibbity', 'flabbity', 'floo' ],STDIN.read).to_s</SPAN></FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV style="font-size: 14px; "><B>Some goals: </B></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><B>Allow for objects as input with snippets as output</B></DIV><DIV>Currently, the choices are simple an Array of strings.</DIV><DIV>We will need to extend this eventually to support objects with values that are snippets.</DIV><DIV>So you'll select your choice based on the key, but the calue of the key/value pair is inserted.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><B>Speed improvements.</B></DIV><DIV>Maybe cache the plists in ram or something.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><B>Line only input.</B></DIV><DIV>Currently we have to do some fancy footwork to insert the right thing in the right way </DIV><DIV>since the input can either be a selection or the current line.</DIV><DIV>And if you're input is a selection, then the command only replaces the selectio, </DIV><DIV>so you have to make sure you don't reinsert the context and the choice_partial and stuff like that.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "></SPAN>thomas AylottÊÑ<SPAN class="Apple-converted-space">Ê</SPAN><I style="font-style: italic; "><SPAN class="Apple-style-span" style="font-style: italic; ">design</SPAN></I><B style="font-weight: bold; "><SPAN class="Apple-style-span" style="font-weight: bold; ">42</SPAN></B><SPAN class="Apple-converted-space">Ê</SPAN>ÑÊ</SPAN><SPAN class="Apple-style-span" style="border-collapse: separate; -khtml-border-horizontal-spacing: 0px; -khtml-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><B style="font-weight: bold; "><SPAN class="Apple-style-span" style="font-weight: bold; "><SPAN class="Apple-style-span" style="font-weight: bold; ">subtleGradientÊ</SPAN></SPAN></B></SPAN><SPAN class="Apple-style-span" style="border-collapse: separate; -khtml-border-horizontal-spacing: 0px; -khtml-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; ">ÑÊ</SPAN><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; ">CrazyEgg<BR class="Apple-interchange-newline"></SPAN></SPAN></SPAN> </DIV><BR><DIV><DIV>On Dec 7, 2006, at 10:06 AM, thomas Aylott wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">Ok. There are now a bunch of people that have signed on to work on this thing.<BR><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Time to start divvying up the workload.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><B>#1: First, we need a Ruby Class for the core essentials of the completion stuff. It needs to:</B></DIV><DIV>Ã<SPAN class="Apple-tab-span" style="white-space:pre">  </SPAN>Be an external library that can be called from a hundred different tmCommands</DIV><DIV><B>X</B><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><B>Be fully runnable from the terminal by manually passing in all the arguments (so, use the TM_* vars only as fallback)</B></DIV><DIV>Ã<SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN>Get the text you're in the middle of writing</DIV><DIV>Ã<SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>Get the list of completions based on that text from somewhere (see #2)</DIV><DIV>Ã<SPAN class="Apple-tab-span" style="white-space:pre">      </SPAN>Show the menu and let you make your selection</DIV><DIV>Ã<SPAN class="Apple-tab-span" style="white-space:pre">       </SPAN>Return a snippet with the results</DIV></BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>