Review Request: Allow language plugins to choose whether a file must be reparsed on whitespace changes or not
Nicolas Alvarez
nicolas.alvarez at gmail.com
Mon Apr 2 00:54:40 UTC 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/104453/#review12103
-----------------------------------------------------------
It might be a good idea to distinguish indentation changes from other whitespace changes, to keep Python from reparsing when I eg. add whitespace around an operator. Make it return an enum instead of a bool: "reparse on whitespace changes = all | none | only indentation".
But this is just my opinion; better wait for other devs :)
language/backgroundparser/documentchangetracker.cpp
<http://git.reviewboard.kde.org/r/104453/#comment9529>
Avoid introducing whitespace at end of lines...
language/interfaces/ilanguagesupport.h
<http://git.reviewboard.kde.org/r/104453/#comment9530>
This doxygen comment may need a bit of expansion, not only explaining what the return value means (if language is sensitive to whitespace) but also what behavior it will affect (if whitespace changes cause a reparse).
- Nicolas Alvarez
On April 1, 2012, 12:52 p.m., Sven Brauch wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/104453/
> -----------------------------------------------------------
>
> (Updated April 1, 2012, 12:52 p.m.)
>
>
> Review request for KDevelop.
>
>
> Description
> -------
>
> Python requires files to be re-parsed on whitespace changes, because the indentation is part of the language syntax. This patch adds a virtual function to ILanguageSupport which can be overwritten by language plugins if they require files to be re-parsed on whitespace changes. The default implementation returns false, so all existing plugins are unaffected.
>
>
> Diffs
> -----
>
> language/backgroundparser/documentchangetracker.cpp 79e63a9
> language/interfaces/ilanguagesupport.h b3cc9eb
> language/interfaces/ilanguagesupport.cpp 94c1f72
>
> Diff: http://git.reviewboard.kde.org/r/104453/diff/
>
>
> Testing
> -------
>
> Seems to work okay.
>
>
> Thanks,
>
> Sven Brauch
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20120402/72315320/attachment.html>
More information about the KDevelop-devel
mailing list