This is an archive of the discontinued LLVM Phabricator instance.

[clangd] New rendering structs
AbandonedPublic

Authored by kadircet on Dec 5 2019, 6:12 AM.

Details

Reviewers
sammccall
Summary

Clangd currently has a really basic formatted string generation
framework and it is not enough to generate some hover responses we want to.

This patch improves that infrastructure by adding more types of nodes and
renderings. While generating markdown, spesifications in
https://github.github.com/gfm/ was followed.

Diff Detail

Event Timeline

kadircet created this revision.Dec 5 2019, 6:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 5 2019, 6:12 AM

Note that I am planning to add more tests, sending out for review to get some initial feedback on the design.

kadircet updated this revision to Diff 232332.Dec 5 2019, 6:19 AM
  • Move function definitions to source file, via define out-of-line :)
kadircet planned changes to this revision.Dec 5 2019, 6:22 AM

Build result: pass - 60511 tests passed, 0 failed and 726 were skipped.

Log files: console-log.txt, CMakeCache.txt

Build result: pass - 60512 tests passed, 0 failed and 726 were skipped.

Log files: console-log.txt, CMakeCache.txt

sammccall added inline comments.Dec 6 2019, 6:19 AM
clang-tools-extra/clangd/FormattedString.h
25

Naming: not sure "string" is the right name - it doesn't represent the things here that are stringiest.

Block? (maybe in a markup namespace?)

34

Comments throughout should probably refer to the semantics (what part of markup is this) rather than its role in the tree.

67

"List" and "Container" commonly mean other things in C++, so I got confused. BulletList?

The comment "Container for a list of documents" describes its structure in the tree rather than its semantics, which most callers (markup composers) will care about. Maybe "A bulleted list. Each item is a child Document"?

I think the comment "each document is prepended..." belongs on renderAsPlainText() if at all

70

obvious attribute here is bullet style (bullets vs numbers) - but you probably only need one for now

82

Document doesn't need to inherit from RenderableString AFAICS, it doesn't need to be embedded in Documents itself, just Lists.

kadircet abandoned this revision.Jan 13 2020, 12:09 AM
kadircet marked 2 inline comments as done.