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

Update ctags to p6.1.20240519.0 #3877

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

techee
Copy link
Member

@techee techee commented May 19, 2024

This PR contains some ctags updates which were made upstream as discussed in #3859.

Apart from that I noticed that the update-ctags.py script didn't copy the updated libreadtags library so I modified it to do so and as a result this PR also contains updated readtags.c/h which was missed in the previous PR.

@techee techee requested a review from b4n May 19, 2024 12:31
@techee
Copy link
Member Author

techee commented May 19, 2024

Just thinking, in #3859 I mapped matlab variables to tm_tag_variable_t so they are displayed in the sidebar but maybe the result is a little too verbose. Especially since it generates a tag for every variable assignment - I just tried it with some random code from github and it displays lots of identical variables in the sidebar, just every time the variable gets assigned.

So shouldn't we rather map it to tm_tag_undef_t?

@elextr
Copy link
Member

elextr commented May 19, 2024

Python does this too, every assignment is a new declaration and shows in the sidebar, on the other hand Julia (where assignment is also declaration) has chosen not to show any assignments in the sidebar, YMMV.

@techee
Copy link
Member Author

techee commented May 19, 2024

Python does this too, every assignment is a new declaration and shows in the sidebar

Yes, but this happens only for the global variables, not variables inside functions. Since the matlab parser is just a dumb regex parser, it doesn't know whether it's inside a function so it shows all assignments and the result is a little too noisy.

@elextr
Copy link
Member

elextr commented May 19, 2024

it doesn't know whether it's inside a function so it shows all assignments and the result is a little too noisy.

Yeah, if they are not scoped then its not very useful.

Copy link
Member

@b4n b4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanna laugh? universal-ctags/ctags#4008 😄

src/tagmanager/tm_parser.c Outdated Show resolved Hide resolved
@b4n
Copy link
Member

b4n commented May 19, 2024

Just thinking, in #3859 I mapped matlab variables to tm_tag_variable_t so they are displayed in the sidebar but maybe the result is a little too verbose. Especially since it generates a tag for every variable assignment - I just tried it with some random code from github and it displays lots of identical variables in the sidebar, just every time the variable gets assigned.

So shouldn't we rather map it to tm_tag_undef_t?

Hum yeah if it's gonna tag every variable assignment in the file regardless of scope, it's probably better to disable indeed, otherwise the more useful tags are likely gonna be hard to find. Maybe tm_local_var_t if we want, to still have goto stuff? Not sure if it's really useful though.

@techee
Copy link
Member Author

techee commented May 26, 2024

So shouldn't we rather map it to tm_tag_undef_t?

Hum yeah if it's gonna tag every variable assignment in the file regardless of scope, it's probably better to disable indeed, otherwise the more useful tags are likely gonna be hard to find. Maybe tm_local_var_t if we want, to still have goto stuff? Not sure if it's really useful though.

I just mapped it to tm_tag_undef_t. Even though mapping to tm_local_var_t would probably work, control-clicking a variable that is assigned many times creates a huge popup with all the assignments which is kind of ugly.

@techee
Copy link
Member Author

techee commented May 26, 2024

Wanna laugh? universal-ctags/ctags#4008 😄

No problem. I've just included the updated jscript parser (without updating the rest). We can update the parsers individually if there are some fixes that should be present in the release.

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

Successfully merging this pull request may close these issues.

None yet

3 participants