This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Introduce bulletlists
ClosedPublic

Authored by kadircet on Dec 12 2019, 8:31 AM.

Diff Detail

Event Timeline

kadircet created this revision.Dec 12 2019, 8:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 12 2019, 8:31 AM
sammccall added inline comments.Dec 13 2019, 12:49 AM
clang-tools-extra/clangd/FormattedString.h
65

This is a class, not a function - comment should focus on what it *is*.

95

Why is it the responsibility of this class to keep track of its indentation within the parent?
This seems like it should be a parameter to the render functions, rather than state.

BTW, it appears to be legal to write lists as:

-
  this is the
  first item
-
  second item

Which is much easier/more regular to generate, because it doesn't require Document to special-case the first line.

kadircet updated this revision to Diff 234059.Dec 16 2019, 7:19 AM
kadircet marked 2 inline comments as done.
  • Move indentation logic into bulletlist.
clang-tools-extra/clangd/FormattedString.h
95

moved indentation logic into bullet list.

but that wouldn't look nice when rendering plain text? also I wouldn't call that special casing, as it just generates trimmed output, like rest of the APIs

Unit tests: pass. 60933 tests passed, 0 failed and 726 were skipped.

clang-format: pass.

Build artifacts: diff.json, CMakeCache.txt, console-log.txt, test-results.xml

sammccall accepted this revision.Jan 7 2020, 4:16 AM
sammccall added inline comments.
clang-tools-extra/clangd/FormattedString.cpp
172

assert that there's no trailing newlines?

clang-tools-extra/clangd/FormattedString.h
75

"items" rather than "documents" would capture the semantics better I think

92

can we document that it *doesn't* render its own trailing newlines? This is a divergence from Block and more important to the implementation now

This revision is now accepted and ready to land.Jan 7 2020, 4:16 AM
This revision was automatically updated to reflect the committed changes.
kadircet marked 3 inline comments as done.