-
Notifications
You must be signed in to change notification settings - Fork 595
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
ctags: fix Ruby parsing for block assigns #1820
base: master
Are you sure you want to change the base?
Conversation
Assigning blocks' return values to variables is a common idiom in Ruby. Fix the ctags parser to take this into account. Closes geany#1744.
@tambeta thanks, does this apply to upstream universal ctags if so probably best to submit it there and then make a PR to pull the modified parser into Geany (unless Geany one has other fixes uctags doesn't). |
The block assign fix (geany#1744) was submitted and accepted to universal-ctags. Pull in the relevant changes.
@elextr, I'm not entirely sure what's the protocol for syncing parser changes from upstream, but I submitted this fix to universal-ctags and it was accepted (universal-ctags/ctags#1734). I've made another commit on this branch pulling in the relevant changes. The improvements can be reviewed using this Ruby test file - using various assignments with blocks no longer breaks the symbols tree. |
LGBI. The commits should be squashed, though. |
I'm hazy on what LGBI means. As to squashing commits, I'm happy to do that, but I'm not sure what the accepted best practice is on an open PR. Is a forced push overwriting the existing commits with a combined one OK, or should a new PR be opened based off a new branch, the existing PR modified to pull from a new branch, or something else? The Geany hacking document does not specify this. |
Don't worry, the squash can be done at merge, but the reminder is always good. I take it that upstream ctags accepted the change. Can you add a test for this? See |
As far as I can tell, it's Australian for "I looked at the code and it seems OK but I didn't test it, and won't be held responsible if it contains any problems". 😄 |
@elextr, upstream did accept the change and the changeset also included a test; I've added it to the PR at hand. |
Improves block assignment handling by accepting assignments to sigiled variables, i.e. those prefixed by `@` or `$` (or really any sequence thereof).
True. I have submitted this fix upstream as well. |
Assigning blocks' return values to variables is a common idiom in Ruby.
Fix the ctags parser to take this into account. Closes #1744.