Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typescript tags generated uncorrected #808

Open
wzprichardwzp opened this issue Feb 20, 2022 · 3 comments
Open

typescript tags generated uncorrected #808

wzprichardwzp opened this issue Feb 20, 2022 · 3 comments

Comments

@wzprichardwzp
Copy link

Im using universal ctags with tagbar, and tagbar is not generating the type information correctly.
I checked and tagbar is indeed using the correct executable (not the one mac has by default).

Screen Shot 2022-02-19 at 10 38 21 PM

Screen Shot 2022-02-19 at 10 39 50 PM

@raven42
Copy link
Collaborator

raven42 commented Feb 21, 2022

@richardwzp I am not very familiar with typescript. Can you describe what it is you are expecting to see?

@wzprichardwzp
Copy link
Author

I was kind of expecting the tags to capture the annotated type

@raven42
Copy link
Collaborator

raven42 commented Feb 24, 2022

Currently the way tagbar functions with regard to the type is one of two ways. The first and more accurate way is if ctags gives us the type. This is seen with the --fields=t output from ctags.

This field isn't supported by all languages in ctags though, so that gives the second approach. If bot found, tagbar will do its best to try and guess at the type. To be consistent, it will extract the contents of the line preceding the tag and use that as the datatype. This cor was added as part of #698, specifically the s:getDataType() routine.

It is not really feasible to create a separate parser for each language within tagbar itself, so the best bet would be to work with the ctags team to add datatype support the typescript language. If that was done, then tagbar should be able to get the type correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants