diff options
| author | Sam McCall <sam.mccall@gmail.com> | 2018-10-24 07:59:38 +0000 |
|---|---|---|
| committer | Sam McCall <sam.mccall@gmail.com> | 2018-10-24 07:59:38 +0000 |
| commit | 16e7070e3e7640f0f081a84ec72b2a8d81f2a668 (patch) | |
| tree | bfb763d0f6a6872c9a26ba20ebccf3164a755145 /clang-tools-extra/test/clangd/fixits-embed-in-diagnostic.test | |
| parent | 1f54500af04bcdc2a4cd41b154778abf691ed300 (diff) | |
| download | bcm5719-llvm-16e7070e3e7640f0f081a84ec72b2a8d81f2a668.tar.gz bcm5719-llvm-16e7070e3e7640f0f081a84ec72b2a8d81f2a668.zip | |
[clangd] Embed fixes as CodeAction, instead of clangd_fixes. Clean up serialization.
Summary:
CodeAction provides us with a standard way of representing fixes inline, so
use it, replacing our existing ad-hoc extension.
After this, it's easy to serialize diagnostics using the structured
toJSON/Protocol.h mechanism rather than assembling JSON ad-hoc.
Reviewers: hokein, arphaman
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D53391
llvm-svn: 345119
Diffstat (limited to 'clang-tools-extra/test/clangd/fixits-embed-in-diagnostic.test')
| -rw-r--r-- | clang-tools-extra/test/clangd/fixits-embed-in-diagnostic.test | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang-tools-extra/test/clangd/fixits-embed-in-diagnostic.test b/clang-tools-extra/test/clangd/fixits-embed-in-diagnostic.test index cd68ea81d3b..f1aa1cfe56c 100644 --- a/clang-tools-extra/test/clangd/fixits-embed-in-diagnostic.test +++ b/clang-tools-extra/test/clangd/fixits-embed-in-diagnostic.test @@ -1,12 +1,12 @@ # RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s -{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{"textDocument":{"publishDiagnostics":{"clangdFixSupport":true}}},"trace":"off"}} +{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{"textDocument":{"publishDiagnostics":{"codeActionsInline":true}}},"trace":"off"}} --- {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///foo.c","languageId":"c","version":1,"text":"struct Point {}; union Point p;"}}} -# CHECK: "method": "textDocument/publishDiagnostics", -# CHECK-NEXT: "params": { -# CHECK-NEXT: "diagnostics": [ +# CHECK: "method": "textDocument/publishDiagnostics", +# CHECK-NEXT: "params": { +# CHECK-NEXT: "diagnostics": [ # CHECK-NEXT: { -# CHECK-NEXT: "clangd_fixes": [ +# CHECK-NEXT: "codeActions": [ # CHECK-NEXT: { # CHECK-NEXT: "edit": { # CHECK-NEXT: "changes": { @@ -27,6 +27,7 @@ # CHECK-NEXT: ] # CHECK-NEXT: } # CHECK-NEXT: }, +# CHECK-NEXT: "kind": "quickfix", # CHECK-NEXT: "title": "change 'union' to 'struct'" # CHECK-NEXT: } # CHECK-NEXT: ], |

