Review Request 122798: Fix rare error case in rangeForIncludePathSpec

Matthew Suozzo matthew.suozzo at gmail.com
Wed Mar 4 05:42:33 UTC 2015


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

Review request for KDevelop.


Repository: kdev-clang


Description
-------

Edits to rangeForIncludePathSpec
================================
#### Fixes an admittedly rare error case where the include parser will yield incorrect results.
* `include`d files whose names include quotes or angle brackets cause issues with the algorithm used
* Ex: `#include "foo<>.h"` is valid in the C preprocessor but only highlighted `foo<>` because '>' was a closing token
* Ex: Same for `#include <foo\".h>` and `#include "foo\".h"`(again, these are real corner cases...)

#### Removes an extraneous check
* KTextEditor::Range already performs the bounds adjustment done at the bottom of `rangeForIncludePathSpec`


Diffs
-----

  clangsupport.cpp f4f49b0 

Diff: https://git.reviewboard.kde.org/r/122798/diff/


Testing
-------

Observed the highlighting of the aforementioned imports. The fix highlighted the mangled import names properly.

kdevelop was also able to suggest functions from these headers so the files themselves seem to be parsed correctly.


Thanks,

Matthew Suozzo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20150304/874227cb/attachment.html>


More information about the KDevelop-devel mailing list