D12220: [RFC] Beautify declaration navigation context by parsing doxygen commands

Milian Wolff noreply at phabricator.kde.org
Mon Apr 16 09:02:08 UTC 2018


mwolff added a comment.


  I'm very unsure about this. On one hand, this obviously looks better in your screenshots. On the other hand, what if we encounter comments that are formatted with some other syntax? Most notably consider how your code would lead to broken HTML quite easily, e.g. when only part of a match is encountered (such as only `\f\[` but no `\f\]`).
  
  Furthermore, you are introducing untranslatable strings that may be odd when rendered (e.g. when the comment is actually German or such). If at all, then I would say we should keep the doxygen strings and just apply formatting, but not change any string conents. So `@see` will be rendered as **@see**, instead of **See also:**

INLINE COMMENTS

> abstractdeclarationnavigationcontext.cpp:792
> +  
> +  for( QString line : comment.split('\n') ) {
> +    line = line.trimmed();

for (auto lineRef : comment.splitRef(QLatin1Char('\n')) {
      QString line = lineRef.trimmed();
      ...
  }

> abstractdeclarationnavigationcontext.cpp:795
> +
> +    line.replace(QRegExp("^(@param|\\\\param)\\[(in|out|in,out)\\] ([\\w]+) (.*)"), "\\2 <strong>\\3</strong>: <em>\\4</em>");
> +    

please don't use QRegExp in new code, use QRegularExpression instead

also, wrap all string literals in QStringLiteral

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D12220

To: progwolff, #kdevelop
Cc: mwolff, croick, kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180416/b9d3f51f/attachment.html>


More information about the KDevelop-devel mailing list