diff --git a/lib/starscope/datum.rb b/lib/starscope/datum.rb index 8927f38..397df0e 100644 --- a/lib/starscope/datum.rb +++ b/lib/starscope/datum.rb @@ -37,7 +37,19 @@ def self.to_s(dat) end def self.ctag_line(dat) - "#{dat[:name][-1]}\t#{dat[:file]}\t/^#{dat[:line]}$/;" + "#{dat[:name][-1]}\t#{dat[:file]}\t/^#{dat[:line]}$/" + self.ctag_ext(dat) + end + + def self.ctag_ext(dat) + s = ";\"\t" + case dat[:type] + when :func + s << "kind:f" + when :class + s << "kind:c" + else + "" + end end def self.cscope_mark(tbl, dat) diff --git a/lib/starscope/db.rb b/lib/starscope/db.rb index 2c3d5cc..8945d82 100644 --- a/lib/starscope/db.rb +++ b/lib/starscope/db.rb @@ -136,9 +136,9 @@ def export_ctags(filename) !_TAG_PROGRAM_URL https://github.com/eapache/starscope // !_TAG_PROGRAM_VERSION #{StarScope::VERSION} // END - defs = (@tables[:defs] || {}).sort + defs = (@tables[:defs] || {}).sort_by {|x| x[:name][-1]} defs.each do |val| - file.puts StarScope::Datum.ctag_line(entry) + file.puts StarScope::Datum.ctag_line(val) end end end