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

Enable local variable and parameter tag reporting for various languages #3275

Merged
merged 2 commits into from Sep 21, 2022

Conversation

techee
Copy link
Member

@techee techee commented Sep 2, 2022

This patch enables local variable and function parameter reporting for
Python, GDScript, PHP, and Typescript.

Because these are dynamic languages and Geany scope autocompletion
relies on static type information, scope completion doesn't work for
these languages. However, at least we get non-scope autocompletion
for local variables and function parameters.

Local variables in GDScript were previously mapped to tm_tag_other_t
and were displayed in the sidebar. We don't display these tags for
C/C++ in the sidebar and they should also be mapped to
tm_tag_local_var_t which is why there is a diff in unit tests removing
these variables from the output.

The python parser generates a slightly different output when function
parameter parsing is enabled (whitespace only change) which causes
the change of the output of some python unit tests.

This version contains fixes related to parsing function parameters.
This patch enables local variable and function parameter reporting for
Python, GDScript, PHP, and Typescript.

Because these are dynamic languages and Geany scope autocompletion
relies on static type information, scope completion doesn't work for
these languages. However, at least we get non-scope autocompletion
for local variables and function parameters.

Local variables in GDScript were previously mapped to tm_tag_other_t
and were displayed in the sidebar. We don't display these tags for
C/C++ in the sidebar and they should also be mapped to
tm_tag_local_var_t which is why there is a diff in unit tests removing
these variables from the output.

The python parser generates a slightly different output when function
parameter parsing is enabled (whitespace only change) which causes
the change of the output of some python unit tests.
@techee techee added the tag-manager Tag manager related patches and bugs label Sep 2, 2022
@kugel- kugel- self-requested a review September 14, 2022 22:13
Copy link
Member

@kugel- kugel- left a comment

Choose a reason for hiding this comment

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

So this basically just updates a few parser to latest universal-ctags and then enables parser features found their? Or did you add the code to python.c?

@techee
Copy link
Member Author

techee commented Sep 14, 2022

So this basically just updates a few parser to latest universal-ctags

Yes, the first patch updates the python ctags parser to the current uctags version (no changes by me, this is a verbatim copy).

and then enables parser features found their?

The second patch sets the mappings of languages that support local variables to tm_tag_local_var_t. The GDScript removal of tags from unit tests is caused by the fact that previously (by mistake) local variables were mapped to normal variables (tm_tag_variable_t).

@elextr
Copy link
Member

elextr commented Sep 15, 2022

LGB quick I

@techee
Copy link
Member Author

techee commented Sep 15, 2022

Will merge this in about a week if nobody complains.

@techee techee merged commit 3952182 into geany:master Sep 21, 2022
@b4n b4n added this to the 1.39/2.0 milestone Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag-manager Tag manager related patches and bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants