ternjs / tern_for_vim

Tern plugin for Vim
MIT License
1.83k stars 100 forks source link

A quick list of all functions would be convenient #144

Closed holybreath closed 8 years ago

holybreath commented 8 years ago

When the code increments, it is very useful to have a list of function names of current file, then I can jump from one function to another quickly. So if you could provide a API to provide this list? I guess it is very easy for tern, because it already has done a excellent analysis work.

I have done some UI work to made a window to show function list, but it is simply based on the "function" string search, so it couldn't work under new es6 grammar.

Thanks!

marijnh commented 8 years ago

Tern would be a good basis to do this, but you'll have to do it in a plugin you write yourself. I'm not adding extra features at the moment.

holybreath commented 8 years ago

@marijnh Hi, I would like to develop such a plugin based on tern, so I want a function like FunctionListOfCurrentFile which I can call directly, could you make it out? Then I may finish this plugin very soon. Thanks!

chemzqm commented 8 years ago

@holybreath I have a npm module that used to find functions parsefunc it's based on acorn (the same as tern), I've also made a plugin unite-js-func to find function in vim, you could use it or take it for example.

holybreath commented 8 years ago

@chemzqm Thanks! your suggestion is very helpful