2011-05-08 8 views
0

vimが私に自動補完を与えることができるように、私はctagsを使って自分のレールアプリケーションのインデックスを作成しようとしています。 しかし、ctagsはすべての単語、特に外部ライブラリへの呼び出しを索引付けしていません。たとえば :ctagsは私が望むすべての単語のインデックスを作成していません

class MultipleChoice < ActiveRecord::Base 
    has_many :options, :class_name => 'MultipleChoiceOption', :foreign_key => :parent_id, :dependent => :destroy 
    accepts_nested_attributes_for :options, :allow_destroy => true 

    def question 
    Question.find_by_data_id_and_data_type(id, MultipleChoice.name) 
    end 

    def randomized_options 
    (0...options.size).to_a.shuffle.map{|index| [index, options[index]]} 
    end 

    def realized_answer(user_answer) 
    user_answer.blank? ? nil : options[user_answer.to_i].content 
    end 

    def answer 
    options.detect{|o| o.correct}.content 
    rescue => e 
    HoptoadNotifier.notify(
     :error_class => "MultipleChoice", 
     :error_message => "Exception while call #answer: #{e.message}", 
     :parameters => {:multiple_choice_id => self.id} 
    ) 
    nil 
    end 
end 

その後ctagsのだろうインデックス多肢選択法(クラス名)、答え(メソッド名)ではなくHoptoadNotifier: 私はこのファイルを持っています。

私はctags -R *

で索引付けしていますが、インデックス、それらすべてにctagsのを伝えるために離れていますか?

答えて

0

まず、HoopsoadNotifierソースがあなたのrailsアプリケーションディレクトリのどこかにあることを確認してください。だから、あなたのディレクトリ内にあなたが持っていると仮定しよう:

これはHoptoadNotifierのソースが格納されています。

cd /railsapp 
ctags -R --tag-relative=yes 

railsapp /と呼ばれるタグ内のファイルを作成し、HoptoadNotifierモジュールのタグ情報が含まれています:

は、次に、以下のコマンドを実行します。

私は多かれ少なかれあなたがしていることを知っているので、HoptoadNotifierソースは自分のディレクトリ構造内にないと思うことができます。また、 "-V"でctagsを実行して、すべてのデバッグ情報を吐き出すことができます。

関連する問題