Review Request 111007: kdevelop: expand macro does not work correctly when the arguments are split over multiple lines
Milian Wolff
mail at milianw.de
Tue Jul 16 08:56:20 UTC 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/111007/#review36025
-----------------------------------------------------------
Great work, many thanks! In the hope to see more contributions, I took the time to review it thoroughly. Please don't be intimidated by these things :)
If you clean it up a bit as I suggested, this should be merged asap. Thanks again!
languages/cpp/cppduchain/navigation/macronavigationcontext.h
<http://git.reviewboard.kde.org/r/111007/#comment26667>
please don't inline that, its not important speed wise
languages/cpp/cpplanguagesupport.cpp
<http://git.reviewboard.kde.org/r/111007/#comment26669>
please add whitespaces around operators
also add a comment to say what this is doing, i.e. something like "properly support macro expansions when arguments contain newlines" or such
languages/cpp/cpplanguagesupport.cpp
<http://git.reviewboard.kde.org/r/111007/#comment26670>
move this out of the loop please
languages/cpp/cpplanguagesupport.cpp
<http://git.reviewboard.kde.org/r/111007/#comment26671>
rather use a for loop and use this as (one of?) the conditions
languages/cpp/cpplanguagesupport.cpp
<http://git.reviewboard.kde.org/r/111007/#comment26668>
please remove the trailing whitespace
languages/cpp/cpplanguagesupport.cpp
<http://git.reviewboard.kde.org/r/111007/#comment26672>
just use tail += textDocument->line(lineNumber).trimmed()
languages/cpp/cpplanguagesupport.cpp
<http://git.reviewboard.kde.org/r/111007/#comment26673>
thats a duplication of the condition above, no? anyhow, if that is rewritten as a for loop it should become clearer
languages/cpp/tests/test_cppassistants.cpp
<http://git.reviewboard.kde.org/r/111007/#comment26662>
rtrim the trailing whitespace please
languages/cpp/tests/test_cppassistants.cpp
<http://git.reviewboard.kde.org/r/111007/#comment26664>
rename that to input please
languages/cpp/tests/test_cppassistants.cpp
<http://git.reviewboard.kde.org/r/111007/#comment26663>
whitespace after comma, and macroposition is actually the line its being expected, right? So I'd rather rename that to e.g. macroLine.
languages/cpp/tests/test_cppassistants.cpp
<http://git.reviewboard.kde.org/r/111007/#comment26666>
here and below, please use the camel case notation, i.e.:
macroWidget
macroNavigationWidget
macroContext
languages/cpp/tests/test_cppassistants.cpp
<http://git.reviewboard.kde.org/r/111007/#comment26665>
use dynamic_cast here and below please, to get the extra testing functionality. Also QVERIFY(macroNavigationWidget)
- Milian Wolff
On June 16, 2013, 4:51 p.m., Hannes Hofer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/111007/
> -----------------------------------------------------------
>
> (Updated June 16, 2013, 4:51 p.m.)
>
>
> Review request for KDevelop.
>
>
> Description
> -------
>
> when a macro is used that requires arguments and those arguments are split over multiple lines kdevelop is not able to expand the macro.
> the expander respects only the current line and therefore the parser does not find the corresponding close brace.
> in this fix the next line is added to the argument list until the close brace is found or EOF is reached.
>
>
> Diffs
> -----
>
> languages/cpp/cppduchain/navigation/macronavigationcontext.h eeaa9f6
> languages/cpp/cpplanguagesupport.cpp e2ff0f1
> languages/cpp/tests/test_cppassistants.h 79fbb99
> languages/cpp/tests/test_cppassistants.cpp 42c7949
>
> Diff: http://git.reviewboard.kde.org/r/111007/diff/
>
>
> Testing
> -------
>
> unit test included.
>
>
> Thanks,
>
> Hannes Hofer
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20130716/f268fd69/attachment-0001.html>
More information about the KDevelop-devel
mailing list