[PATCH] D76094: [clangd] Change line break behaviour for hoverinfo

Lorenz Junglas via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 23 06:31:03 PDT 2020


lolleko updated this revision to Diff 252006.
lolleko added a comment.

Adressed 2nd Review

The problem with the changes you proposed is that it doesn't handle paragraphs (\n\n).
I think the conditionals required to make that work wouldn't be much cleaner than the current solution.

And I do think parahraphs in comments should be retained. I agree that not every hard line break should be a pargraph.
But actual parahraphs should be retained e.g.:

  	/**
  	 * Condition for calling UpdateOverlaps() to initialize overlap state when loaded in during level streaming.
  	 * If set to 'UseConfigDefault', the default specified in ini (displayed in 'DefaultUpdateOverlapsMethodDuringLevelStreaming') will be used.
  	 * If overlaps are not initialized, this actor and attached components will not have an initial state of what objects are touching it,
  	 * and overlap events may only come in once one of those objects update overlaps themselves (for example when moving).
  	 * However if an object touching it *does* initialize state, both objects will know about their touching state with each other.
  	 * This can be a potentially large performance savings during level streaming, and is safe if the object and others initially
  	 * overlapping it do not need the overlap state because they will not trigger overlap notifications.
  	 * 
  	 * Note that if 'bGenerateOverlapEventsDuringLevelStreaming' is true, overlaps are always updated in this case, but that flag
  	 * determines whether the Begin/End overlap events are triggered.
  	 * 
  	 * @see bGenerateOverlapEventsDuringLevelStreaming, DefaultUpdateOverlapsMethodDuringLevelStreaming, GetUpdateOverlapsMethodDuringLevelStreaming()
  	 */

I think once proper paragraphs are in. The linebreak parsing could be rewritten into 2 steps:

1. Split on `\n\n` to extract actual paragraphs.
2. Use the solution you proposed to split and join new lines.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76094/new/

https://reviews.llvm.org/D76094

Files:
  clang-tools-extra/clangd/Hover.cpp
  clang-tools-extra/clangd/Hover.h
  clang-tools-extra/clangd/unittests/HoverTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76094.252006.patch
Type: text/x-patch
Size: 8550 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200323/aac6bbec/attachment-0001.bin>


More information about the cfe-commits mailing list