Skip to content

One way to handle multi-line prototypes in arduino files #117

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

Closed
wants to merge 2 commits into from

Conversation

focalintent
Copy link
Contributor

A somewhat heavy handed way to deal with #80 if we detect that the code for a tag is multiline (that is, there's no closing paren), use the Filename/Line info in the tag to attempt to read a few lines from the original code to hopefully get a better block of code to look for the prototype in.

…at the code for a tag is multiline (that is, there's no closing paren), use the Filename/Line info in the tag to attempt to read a few lines from the original code to hopefully get a better block of code to look for the prototype in.
@focalintent
Copy link
Contributor Author

While this does add a bunch of file i/o from a quick run of a few dozen apps here, it appears that most multi-line prototypes end up coming out of ino files, and the time overhead for this doesn't appear to be noticeable in my runs here.

@facchinm
Copy link
Member

Hi @focalintent , this is a great news! Would you mind adding a test under ctags_parser_test.go to demonstrate the new functionality?
Thanks a lot!

@focalintent
Copy link
Contributor Author

Sure - it'll take a little bit for me to get one put together (first time messing with go at all - and also, because this fix involves reaching back into the original file mentioned in the file field of the ctags output to open it up to do the prototype finding/matching, I can't quite use the existing ctags parser test templates - though I think i'm getting a rough idea how to put together a test for it).

@focalintent
Copy link
Contributor Author

Doing a test for this is a bit more complex - because the fix involves going back to the original input file the existing test case's plan of reading text from lines of ctags output isn't sufficient to test, and unfortunately, I'm about to take off for a couple of weeks, so I won't be able to get back to this until mid-march some time.

@focalintent
Copy link
Contributor Author

Ah, saw how to do sketch/build tests - should be able to do that later tonight.

@focalintent
Copy link
Contributor Author

@facchinm added a test case for this (sorry for the delay! new to go and the arduino-builder source)

@facchinm
Copy link
Member

Rebased and merged as fbfaa56

@facchinm facchinm closed this Mar 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants