vim tagbar如何生成适当的ruby DSL结构

时间:2017-08-01 09:02:15

标签: ruby vim ctags

如果我使用grape构建http api,如下面的ruby代码:

module Twitter
  class API < Grape::API

    helpers do
      def current_user
        @current_user ||= User.authorize!(env)
      end

      def authenticate!
        error!('401 Unauthorized', 401) unless current_user
      end
    end

    resource :statuses do
      desc 'Return a public timeline.'
      get :public_timeline do
        ...
      end

      desc 'Return a personal timeline.'
      get :home_timeline do
        ...
      end


      desc 'Create a status.'
      post do
        ...
      end

      desc 'Update a status.'
      put ':id' do
        ...
      end

      desc 'Delete a status.'
      delete ':id' do
        ...
      end
    end
  end
end

我希望vim tagbar插件显示生成正确的结构,但不是,如下面的截图:

enter image description here

它只将def视为代码的结构。如何将标记栏视为resourcedsec作为结构?

0 个答案:

没有答案