Review Request 122169: Use oldcpp behavior when inserting include paths.

Milian Wolff mail at milianw.de
Mon Apr 27 08:35:00 UTC 2015



> On April 27, 2015, 6:59 a.m., Sergey Kalinichev wrote:
> > I'm just wondering why we can't use the regexp anymore and have to switch to the hand-made parser? The regexp takes up less space and much easy to understand IMO (e.g. currently I fail to grasp what the rightBoundary parameter for. Seems like everything should work just fine without it...)
> > 
> > What is more important: if I have a foo.h file and type:
> > \#include "foo|"
> > Then invoke code-completion at | and select the foo.h item I get: #include "foofoo.h" 
> > Which is obviously wrong.

I failed to implement this behavior in a sane way with a regular expression. If you start to allow comments everywhere it gets super hard to write a correct regexp for this. I don't think the super long regex that may be written would be easier to understand than this simple parser.

Thanks for the failing test though, I'll add a test for that and ensure it works later.

Bye


- Milian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/122169/#review79551
-----------------------------------------------------------


On April 21, 2015, 3:03 p.m., Milian Wolff wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122169/
> -----------------------------------------------------------
> 
> (Updated April 21, 2015, 3:03 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdev-clang
> 
> 
> Description
> -------
> 
> This is much better, in my opinion. It allows one to easily include
> long paths as well as change existing includes more easily as the
> rest of the line gets removed as well.
> 
> Additionally, comments get taken into account as well as whitespaces.
> An extensive unit test suite is added.
> 
> REVIEW: 122169
> 
> 
> Diffs
> -----
> 
>   codecompletion/includepathcompletioncontext.cpp 9dea2879418c4f81ab1927d848c831b092bd11e6 
>   codecompletion/model.h 961bdf5cc4a33a9b41cea0cc8c81f0ecfb647b1f 
>   tests/test_clangutils.cpp 1a3c85f4e5c288a5bdbc742ee65e61ba1c49cd9f 
>   tests/test_codecompletion.h 20cc5a94d51062d12674d6823ced10c056c067bc 
>   tests/test_codecompletion.cpp 465c57d7575d9e56776aadf3e200a209e40d24c5 
>   tests/test_duchainutils.cpp 1ae10f1d6686d2823c4cda4ffde34d10460ac3d0 
> 
> Diff: https://git.reviewboard.kde.org/r/122169/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Milian Wolff
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20150427/649a7356/attachment-0001.html>


More information about the KDevelop-devel mailing list