For full completion functionality - where swcs are included when searching for the completions results - you need to have the 'nokogiri' and 'rubyzip' gems installed. The default ruby shipping on OS X is 1.8.7 so the easiest solution is to switch to the system default ruby and install the nokogiri and rubyzip gems there.
However the following should also work....
TextMate 2, rvm (with ruby 1.9.3 installed) and the AS3 bundle are installed on your machine and when you try to autocomplete an error gets thrown.
Create the gemset the ActionScript 3 bundle needs to be fully functional
rvm gemset create tmas3
rvm use 1.9.3@tmas3
Install the required gems
gem install rubyzip
gem install nokogiri
Create the rvm textmate wrapper
rvm wrapper 1.9.3@tmas3 textmate
Open TextMate preferences and set the var TM_RUBY
to /Users/{YOUR_USER_NAME}/.rvm/bin/textmate_ruby
Restart TextMate and autocompletion should be working, if you suspect that swc's aren't being searched then ~/Library/Logs/TextMate ActionScript 3.log will confirm it.
The class I use is very simple.
And I also found that:
and I try to track into the error but don’t konw where to begin...
So I just uninstalled TM2 and use TM Version 1.5.11 (1635). After I set the shell variables as blow, auto completion seems working fine(it can import default flex_sdk class).
PATH
:/usr/bin:/bin:/usr/sbin:/sbin:/Users/zhangnaixiao/SDKs/flex_sdk_3/bin
TM_FLEX_PATH
:/Users/zhangnaixiao/SDKs/flex_sdk_3
TM_FLEX_USE_FCSH
:true
TM_AS3_USUAL_SRC_DIRS
:/Users/zhangnaixiao/SDKs
Here is another question: Can I import other class which is in a common source folder(not in flex_sdk, with putting the folder into the project)?