It's now been two weeks since I said I would have developed further on the Lift TextMate bundle in one week so I though I'd better start writing ;)
Last time I said I would implement the following features
- Primitive autocompletion for methods of the current objet. This is only realistic when the type of the object has been explicitly stated in the document
- Snippet output
- Images in the drop-down list that indicates if it's a function, object or a class
And so far I've managed to get #1 and #2 done, I'm fairly happy with the result even though it's not that clever when it comes to working out the type of a variable - I'll be teaching it a thing or two before the next release
What is planned for the future:
- Improving the type interference (it's extremely lightweight now)
- Teach it about packages to help your organize/add/remove imports
NB: Ctags was created to help the developer navigate source files and as such it doesn't record each function in each Class/Object/Trait but instead each function in each of the files it analyzes. This means that you might get some weird suggestion if there's more than one class in each file. But don't worry the compiler won't allow you to do anything illegal :)
I'll be rolling out my own static analyzer when I get the time (hopefully soon) to address this issue
Requirements
- If you don't have it already install ctags
- Add the contents of this file to your .ctags file. If you don't have one already simple place this one in your home folder (~/)
How to get started
- Download the bundle here
- Add the following shell variables to TextMate LIFTWEB_PATH - point it to the lift source code for me this is /Users/Mads/Dev/liftweb/framework/. If you don't have it download it here and SCALA_LIBRARY_PATH - point it to the scala library source code for me this is /Users/Mads/Dev/scala-2.7.7.final-sources/src/library/ you can download it here
- Create the ctags file by pressing cmd+shift+c
- Code, code, code - try hitting option+escape every once in a while to see if it works
As stated above it's not very good at figuring out the type of a variable yet - in fact it only knows what type to look for when you explicitly state it like so:
val myList :Array[String] = "H,e,l,l,o".split(",")
This is not very convienient as it forces you to drop type-interference, however, if you want to get a list of the methods List has you can simply type 'List.' and hit option+escape
Remember this is still extremely beta - It works for me but I can't promise it will work for you. If you find any issues feel free to fork me on github and help me out :)