[TxMt] tm_dialog enhancements for completion

Hans-Joerg Bibiko bibiko at eva.mpg.de
Thu Sep 6 08:08:31 UTC 2007


Hi,

Joachim Mårtensson wrote a marvelous extension to tm_dialog - the  
code completion popup.
(See his mail http://lists.macromates.com/pipermail/textmate/2007- 
August/021853.html)

Now I had the idea to enhance it a bit in respect of file/path name  
completion and a word completion based on cocoa's spell checker  
dictionaries.


####
File/Path completion:
tmCommand:
"$DIALOG" -f -p '{pathcompletion=YES;}'
Input: None
Output: Show as Tool Tip (for errors messages)

It turns out that this is the fastest way to insert a path I ever saw ;)
If you type '/App' it will start there and inserts the longest match  
automatically.
If the current document is saved and you type ' ' it starts at  
TM_DIRECTORY.
Is there TM_SUPPORT_PATH or TM_BUNDLE_SUPPORT before the caret and  
you type e.g. ' ' it starts at the given path.
The popup window doesn't disappear if I inserted an item. Instead it  
shows the content of the inserted path.

####
Word Completion
tmCommand:
"$DIALOG" -f -p '{wordcompletion=YES;lang=nl_NL;}' or "$DIALOG" -f -p  
'{wordcompletion=YES;lang=en_GB;}'
Input: None
Output: Show as Tool Tip (for errors messages)

By my opinion it's better than cocoa's built-in completion ;)
It also doesn't disappear if I append a new character to my word or  
if I delete a character. Instead it shows new suggestions.


A demo can be found at:
http://www.bibiko.de/TM_completion.mov (2.6MB)

Some tiny things have to be done but the tentative code works. If I  
fixed them I will post the changes to Joachim. He will commit it to the
http://macromates.com/svn/Bundles/branches/Dialog%20PlugIn% 
20Completion%20Menu/ branch.

My question is whether there are other possibilities to use this  
extraordinary extension.
One idea would be to feed this popup window with TM's internal  
completion list but up to now I didn't find a way to have access to  
it (Allan?).

Comments, suggestions?

Cheers,

Hans




More information about the textmate mailing list