[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-07 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL360151: [clangd] Introduce intermediate representation of formatted text (authored by ibiryukov, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-07 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 198463. ilya-biryukov marked an inline comment as done. ilya-biryukov added a comment. - Update a comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58547/new/ https://reviews.llvm.org/D58547 Files:

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-07 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/FormattedString.h:34 + /// markdown. + /// EXPECTS: Code does not contain newlines. + void appendInlineCode(std::string

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-06 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/FormattedString.cpp:71 + // start and end the code block with more. + unsigned MaxBackticks = 0; + for (llvm::StringRef Left = Input;;) { sammccall wrote: > ``` > backticks = "```" >

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-06 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 198300. ilya-biryukov added a comment. - Remove hover-related bits, they will go into a separate revision Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58547/new/ https://reviews.llvm.org/D58547 Files:

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-06 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 198298. ilya-biryukov marked 7 inline comments as done. ilya-biryukov added a comment. - Use isWhitespace from CharInfo. - Add a comment for merging text blocks together. - Remove assertion that inline code block does not contain newlines. - Simplify

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-06 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. As discussed, it probably makes sense to split into two patches, adding this abstraction and using it. (All together is also fine but should have the tests for the new behavior, which probably means renderForTests() too) Generally looks good. I think we'll run into

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-03 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 197994. ilya-biryukov marked an inline comment as done. ilya-biryukov added a comment. - Remove dead test code. NFC Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58547/new/

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-03 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. This is ready for another round of review. As mentioned in the comments, I think some of the comments are better addressed by a separate change, because they would touch lots of lines in the test. Let me know if I missed anything else. Repository: rG LLVM

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-03 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/ClangdServer.h:186 void findHover(PathRef File, Position Pos, - Callback> CB); + Callback> CB); ilya-biryukov wrote: > kadircet wrote: > > sammccall

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-03 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked 2 inline comments as done. ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/FormattedString.h:27 + /// Append plain text to the end of the string. + void appendText(std::string Text); + /// Append a block of C++ code. This

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-03 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 197991. ilya-biryukov added a comment. - Remove a FIXME that was fixed Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58547/new/ https://reviews.llvm.org/D58547 Files:

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-03 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 197989. ilya-biryukov marked an inline comment as done. ilya-biryukov added a comment. - Return 'HoverInfo' instead of FormattedString - Reformat Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58547/new/

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-03 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked an inline comment as done. ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/ClangdServer.h:186 void findHover(PathRef File, Position Pos, - Callback> CB); + Callback> CB);

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-03 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked an inline comment as done. ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/FormattedString.cpp:41 + +void FormattedString::appendCodeBlock(std::string Code) { + Chunk C; sammccall wrote: > you may want to take the

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-03 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 197986. ilya-biryukov marked 7 inline comments as done. ilya-biryukov added a comment. - Rebase - Parse client capabilities, send markdown on hover if client supports it - Use inline block for the scope - Add a language for code blocks - Add a FIXME for

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-03 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/ClangdServer.h:186 void findHover(PathRef File, Position Pos, - Callback> CB); + Callback> CB); sammccall wrote: > Not sure about switching from `Hover` to

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-05-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. This looks pretty nice to me! Sorry for the wait. Adding @kadircet as hover-guru-in-waiting. Comment at: clang-tools-extra/clangd/ClangdLSPServer.cpp:814 +return Reply(llvm::None); + // FIXME:

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-02-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. This is a follow-up for a discussion from D55250 . Still missing test, wanted to get some input on the API first. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58547/new/

[PATCH] D58547: [clangd] Introduce intermediate representation of formatted text

2019-02-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added reviewers: malaperle, sammccall, ioeric. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, mgorny. Herald added a project: clang. That can render to markdown or plain text. Used for findHover requests. Repository: rG LLVM