alibaba/structure-view

Support for more languages?

nicolashainaux opened this issue · 3 comments

It may be worth joining efforts on the same plugin rather than scattering through various projects.
The .ctags version of symbols-tree-nav has been patched several times, maybe you could take it to update the one of structure-view to better support languages (and/or support more)?

symbols-tree-view, as well as symbols-tree-nav, uses an external binary to parse the files, I think the support for several languages is only due to this binary even if the current version is broken for several languages in symbols-tree-view. For instance there's no regex for python in the .ctags files of symbols-tree-view (nor symbols-tree-nav), yet python is supported. I don't understand completely how you parse files (looks like everything is done in javascript?), but maybe an external binary would allow a support for more languages?

@nicolashainaux Totally agree with you. Structure-view absorbs that .ctags file with ctags binaries as backup solution for those languages haven't been deep supported yet. I guess that .ctags could be a supplement for ctags, even if there's no regex for py in it.
But I don't think ctags could parse every language professionally, as well as spawn a child process and get the raw data from stdout is not elegant. So I make a hybrid language parser, as you can see JS files look better because there is a specific parser for JS. When parsing an language, structure-view will find specific parser first, and then use ctags if specific parser is not existed.

image

You can add Latex to the List of supported languages, it works out of the box with ctags 👍

Your Idea with ctags as backup solutions and own parsing for your most demanded languages is a nice idea.

I would like to mention that someone has done a more complete Latex Viewer available here