Git Product home page Git Product logo

coffeetags's People

Contributors

bitdeli-chef avatar derenio avatar gingerhendrix avatar gonzih avatar hikerpig avatar louisrli avatar lukaszkorecki avatar masatake avatar mtscout6 avatar rkachowski avatar shirosaki avatar viveksjain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

coffeetags's Issues

coffeetags --vim-config

tagbars api changed new code showld look like this

if executable('coffeetags')
    let g:tagbar_type_coffee = {
        \ 'ctagsbin' : 'coffeetags',
        \ 'ctagsargs' : ' --include-vars ',
" this is where things changed
        \ 'kinds' : [
           \ 'f:functions:0',
           \ 'o:objecs:1',
       \ ],
       \ 'sro' : ".",
       \ 'kind2scope' : {
           \ 'f' : 'functions',
           \ 'o' : 'objecs',
      \ }
   \ }

endif

undefined method `each_with_index' error

/usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/CoffeeTags-0.0.2.4/lib/CoffeeTags/parser.rb:37:in block in mark_commented_lines': undefined method each_with_index' for #String:0x007fddf282abe0 (NoMethodError)
^Ifrom /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/CoffeeTags-0.0.2.4/lib/CoffeeTags/parser.rb:35:in tap' ^Ifrom /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/CoffeeTags-0.0.2.4/lib/CoffeeTags/parser.rb:35:inmark_commented_lines'
^Ifrom /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/CoffeeTags-0.0.2.4/lib/CoffeeTags/parser.rb:27:in initialize' ^Ifrom /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/CoffeeTags-0.0.2.4/lib/CoffeeTags.rb:108:innew'
^Ifrom /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/CoffeeTags-0.0.2.4/lib/CoffeeTags.rb:108:in block in run' ^Ifrom /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/CoffeeTags-0.0.2.4/lib/CoffeeTags.rb:106:ineach'
^Ifrom /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/CoffeeTags-0.0.2.4/lib/CoffeeTags.rb:106:in run' ^Ifrom /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/CoffeeTags-0.0.2.4/bin/coffeetags:7:in<top (required)>'
^Ifrom /usr/local/Cellar/ruby/1.9.3-p125/bin/coffeetags:19:in load' ^Ifrom /usr/local/Cellar/ruby/1.9.3-p125/bin/coffeetags:19:in

'
!_TAG_FILE_FORMAT^I2^I/extended format/
!_TAG_FILE_SORTED^I0^I/0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR^IŁukasz Korecki /[email protected]/
!_TAG_PROGRAM_NAME^ICoffeeTags^I//
!_TAG_PROGRAM_URL^Ihttps://github.com/lukaszkorecki/CoffeeTags^I/GitHub repository/
!_TAG_PROGRAM_VERSION^I0.0.2.4^I//

support for exported classes using class @Foo

Hey!
Thanks for CoffeeTags. It's really cool. Just one little thing that prevents it from working with our codebase:
We' re using the @classname notation to make classes declared in one .coffee file visible to other files (in a Browser/Frontend context), for example:

class @Controller

  constructor: ->
    @pool=DataPool.getInstance()
    @initUser()

  initUser: =>
    # fetch the current user
    @user = @pool.currentUser()

this will make the Controller class assigned to window.Controller.
CoffeeTags doesn't seem to recognize this syntax. Instead, in TagBar, I see a "window" object directly containing the methods of the class as functions, without a mention of the actual class name. Like:

window* : object
  constructor : function
  initUser : function

I'd expect:

Controller : class
  constructor : function
...

Would that be possible?
Thanks!

Create tags for variables and comprehensions

Variable Declarations

*dir* = fs.readdirSync __dirname
f     = _dir_ + '/foo'

Pressing <C-]> on the underscore'd _dir_ would jump to the starred *dir*

Comprehension Declarations

 for *f* in dir
      do (f) ->
           console.log _f_

Pressing <C-]> on the underscore'd _f_ would jump to the starred *f*

litcoffee compatibility

First of all, thank you for this plugin! However, how do I make this work with *.litcoffee files?

class methods are not identified correctly

If I have a class with 'class methods', i.e.:

class A
    @compileXml: (codeXml) ->

Then the output tag file has the symbol as '@compileXml', when the symbol should be 'compileXml'.

Add support for ReactJS for classes

Hi,

first of all... this plugin is great !!! So bravo !!!

I'm using CoffeeScript with ReactJS.

Is it possible to add the following templates as a "class" ?

module.exports = Edit = React.createClass

But most of the time I'm using this little trick

module.exports = exp = {}
[...]
exp.Edit = Edit = React.createClass

Or can I had it myself somewhere ? Sorry I never used Rails :(

Best regards

--vim-conf documented but not supported

It looks like --vim-conf was removed as a feature, but it's referenced by the gist pointed to by the --help text:
CoffeeTags + TagBar + Vim ---> https://gist.github.com/1935512

I'm trying to get tagbar to work (which I successfully use with exuberant ctags) with coffeescript files.

Now that the vim-conf option is gone, I don't know how to set it up as a filetype plugin. The documentation should be updated to not use the old parameter, as well as indicate the correct way to set up a filetype plugin to work with tagbar.

Include class references in generated tags

Awesome project. I really appreciate how well it maps functions and variables.

I would really love if it would also dump out tags for the class names themselves.

E.g.

class Animal
  constructor: (@name) ->

  move: (meters) ->
    alert @name + " moved #{meters}m."

Currently spits out tags for constructor and move. If it also spat out a tag for Animal, then I could jump to Animal from another file that references the Animal class.

Would you consider adding this? Or am I missing an existing option that triggers this behavior?

ctrlp.vim or unite.vim?

Hi, thanks for a great plugin!

While everything works as intended in Tagbar, no tags show up in plugins like ctrlp or unite. I was under the impression that these plugins share the same tag indexes, but maybe I'm wrong?

Emacs support

Trying to use this in emacs, but I get an 'is not a valid tags table' error, any clues?

The exuberant ctags format is probably what's needed.

capturing overridden methods

move of Animal is captured but that of Snake and Horse are not captured. Is this expected bahvior?

This is part of test cases of universal-ctags(http://ctags.io).
Before updating coffeetags installed via gem all move are captured. Maybe version 0.2.x.
After updating to 0.6.0, I found only move of Animal was captured.

[yamato@x201]~/var/ctags-github/Units/main-xcmd.r/xcmd-coffeetags.d% cat input.coffee 
# Taken from http://coffeescript.org/

class Animal
  constructor: (@name) ->

  move: (meters) ->
    alert @name + " moved #{meters}m."

class Snake extends Animal
  move: ->
    alert "Slithering..."
    super 5

class Horse extends Animal
  move: ->
    alert "Galloping..."
    super 45
[yamato@x201]~/var/ctags-github/Units/main-xcmd.r/xcmd-coffeetags.d% coffeetags -f - input.coffee
!_TAG_FILE_FORMAT   2   /extended format/
!_TAG_FILE_SORTED   0   /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR    Łukasz Korecki /[email protected]/
!_TAG_PROGRAM_NAME  CoffeeTags  //
!_TAG_PROGRAM_URL   https://github.com/lukaszkorecki/CoffeeTags /GitHub repository/
!_TAG_PROGRAM_VERSION   0.6.0   //
Animal  input.coffee    /^class Animal$/;"  c   line:3  language:coffee
Horse   input.coffee    /^class Horse extends Animal$/;"    c   line:14 language:coffee
Snake   input.coffee    /^class Snake extends Animal$/;"    c   line:9  language:coffee
constructor input.coffee    /^  constructor: (@name) ->$/;" p   line:4  language:coffee object:Animal
move    input.coffee    /^  move: (meters) ->$/;"   p   line:6  language:coffee object:Animal

License missing from gemspec

Some companies will only use gems with a certain license.
The canonical and easy way to check is via the gemspec
via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

There is even a License Finder to help companies ensure all gems they use
meet their licensing needs. This tool depends on license information being available in the gemspec.
Including a license in your gemspec is a good practice, in any case.

How did I find you?

I'm using a script to collect stats on gems, originally looking for download data, but decided to collect licenses too,
and make issues for missing ones as a public service :)
https://gist.github.com/bf4/5952053#file-license_issue-rb-L13 So far it's going pretty well

tags not printed in tagbar VIM

hello i em trying to do this and it wont work
when i check if g:tagbar_type_coffee is set, it is
but it wont display any tags ... i ultimately plan to add this code
snipped as a ftplugin ... i have already done so for lushtags
another tagbarplugin and it worked then

   au FileType coffee call coffeetags () 
   function! coffeetags ()
   " Add this type definition to your vimrc
   " or do
   " coffeetags --vim-conf >> <PATH TO YOUR VIMRC>
   " if you want your tags to include vars/objects do:
   " coffeetags --vim-conf --include-vars
   if executable('lushtags')
           let g:tagbar_type_coffee = {
                             \ 'ctagsbin' : 'coffeetags',
                             \ 'ctagsargs' : ' --include-vars ',
                             \ 'kinds' : [
                                 \ 'f:functions',
                                 \ 'o:object'
                             \ ],
                             \ 'sro' : ".",
                             \ 'kind2scope' : {
                                 \ 'f' : 'object',
                                 \ 'o' : 'object'
                             \ },
                         \ }
            endif
   endfunction

Deal with 'fat rockets'

=> is a valid function indicator as well

parser.rb : L61, change the regex to accept fat rockets:

    if not token.nil? and line =~ /(:?-|=)\>/

hacking that in on my system causes it to discover more functions.

Adds a lot of tags that it shouldn't add

I've noticed that CoffeeTags has been adding a lot of things as tags where it shouldn't. For example, it's reading any line that starts with document, such as

document.getElementById('arrow')

and marking it as a do block.

Something similar is happening with classes. Every time that I use a method name that has a capital letter in it, CoffeeTags tries to make a new class out of it. So this line

object.classList.add 'class-name'

Will make List.add as a class.

don't work

I try with lastest tagbar and
ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
tagbar produce empty window, sad

Link to demo does not work

I would like to see CoffeeTags in action but unfortunately the link in the readme is currently broken.

"exported" classes

This syntax can be seen in 37signals' Pow

module.export = class Configuration

this isn't correctly parsed by coffeetags

Improve documentation

Docs pretty much don't exist, it could be useful to document the code here and there

Vim plugin broken on windows

When using the vim plugin in windows I get the error ruby.exe No such file or directory -- <workdir>/coffeetags (LoadError)

Full :mess

Executed command: ""coffeetags" "C:\Users\ksh\AppData\Local\Temp\VIA8C2F.tmp.coffee""
Command output:
ruby.exe: No such file or directory -- Z:/workfolder/coffeetags (LoadError)

coffeetags --vim-config

tagbars api changed new code showld look like this

if executable('coffeetags')
    let g:tagbar_type_coffee = {
        \ 'ctagsbin' : 'coffeetags',
        \ 'ctagsargs' : ' --include-vars ',
" this is where things changed
        \ 'kinds' : [
           \ 'f:functions:0',
           \ 'o:objecs:1',
       \ ],
       \ 'sro' : ".",
       \ 'kind2scope' : {
           \ 'f' : 'functions',
           \ 'o' : 'objecs',
      \ }
   \ }

endif

Multiline comment (###) causes coffeetag to malfunction if it starts and ends in the same line.

The following file generates the following CTAG output only for the function foo, not bar.

foo = -> console.log 'hello, world'
### comment here. ###
bar = -> console.log 'hello, world'

Output:

!_TAG_FILE_FORMAT   2   /extended format/
!_TAG_FILE_SORTED   0   /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR    Łukasz Korecki /[email protected]/
!_TAG_PROGRAM_NAME  CoffeeTags  //
!_TAG_PROGRAM_URL   https://github.com/lukaszkorecki/CoffeeTags /GitHub repository/
!_TAG_PROGRAM_VERSION   0.0.2.6 //
foo test.coffee /foo/;" f   lineno:1    object:window   type:function

However, if the multiline comment is splited into multiple lines, such as

###
comment here.
###

The correct output is generated

!_TAG_FILE_FORMAT   2   /extended format/
!_TAG_FILE_SORTED   0   /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR    Łukasz Korecki /[email protected]/
!_TAG_PROGRAM_NAME  CoffeeTags  //
!_TAG_PROGRAM_URL   https://github.com/lukaszkorecki/CoffeeTags /GitHub repository/
!_TAG_PROGRAM_VERSION   0.0.2.6 //
foo test.coffee /foo/;" f   lineno:1    object:window   type:function
bar test.coffee /bar/;" f   lineno:5    object:window   type:function

invalid byte sequence in US-ASCII

coffeetags -R -f tags fails with an error "invalid byte sequence in US-ASCII" in my osx 10.9.5.

Users/codeout/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/CoffeeTags-0.5.0/lib/CoffeeTags/parser.rb:44:in `=~': invalid byte sequence in US-ASCII (ArgumentError)

(I've tried ruby 1.9.3-p545, 2.0.0-p481 and 2.1.2)

Can we suppose that *.coffee are in US-ASCII while creating tags?
I'm not familiar with tags specs really but I guess keywords of CoffeeScript should be US-ASCII.

Some of specs also failed with the same error as below:

  1) Coffeetags::Utils Complete output appends tags for given file
     Failure/Error: Coffeetags::Utils.run({ :output => 'test.out', :files => ['spec/fixtures/campfire.coffee'], :append => true })
     ArgumentError:
       invalid byte sequence in US-ASCII
     # ./lib/CoffeeTags.rb:143:in `block in setup_tag_lines'
     # ./lib/CoffeeTags.rb:143:in `reject'
     # ./lib/CoffeeTags.rb:143:in `setup_tag_lines'
     # ./lib/CoffeeTags.rb:100:in `run'
     # ./spec/coffeetags_spec.rb:142:in `block (3 levels) in <top (required)>'

Process directories recursively

coffeetags **/*.coffee -f tags dumps tags for all coffeescript files to the file specified by -f flag (similarly to original ctags)

coffeetags parses comments

    [maarten@laptop: test]$ echo '# TODO: -> blabla' > test.coffee
    [maarten@laptop: test]$ coffeetags -R
    !_TAG_FILE_FORMAT   2   /extended format/
    !_TAG_FILE_SORTED   0   /0=unsorted, 1=sorted, 2=foldcase/
    !_TAG_PROGRAM_AUTHOR    Łukasz Korecki /[email protected]/
    !_TAG_PROGRAM_NAME  CoffeeTags  //
    !_TAG_PROGRAM_URL   https://github.com/lukaszkorecki/CoffeeTags /GitHub repository/
    !_TAG_PROGRAM_VERSION   0.0.1.8 //
    TODO    ./test.coffee   /TODO/;"    f   lineno:1    object:window   type:function

I see classes with a lot of 'TODO' methods showing up in Tagbar :)

CoffeeTags shows the class below as having a constructor and a method called "TODO"

    class MyClass
      # TODO: -> blabla

      constructor: -> console.log 'hello'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.