diff options
| author | Ilya Biryukov <ibiryukov@google.com> | 2018-02-14 10:52:04 +0000 |
|---|---|---|
| committer | Ilya Biryukov <ibiryukov@google.com> | 2018-02-14 10:52:04 +0000 |
| commit | 7beea3ab73b35e9dd3bd2fc2f4232cf41e41adc4 (patch) | |
| tree | b49302a9186302f0b5c02734051fdec8ad14749e /clang-tools-extra/clangd/ClangdLSPServer.cpp | |
| parent | 6a77bdb1ebca2f9b5cc8b9e8b9b25a860453bc42 (diff) | |
| download | bcm5719-llvm-7beea3ab73b35e9dd3bd2fc2f4232cf41e41adc4.tar.gz bcm5719-llvm-7beea3ab73b35e9dd3bd2fc2f4232cf41e41adc4.zip | |
[clangd] Explicitly initialize all primitive fields in Protocol.h
Summary:
Some of the existing structs had primimtive fields that were
not explicitly initialized on construction.
After this commit every struct consistently sets a defined value for
every field when default-initialized.
Reviewers: hokein, ioeric, sammccall
Reviewed By: sammccall
Subscribers: klimek, cfe-commits, jkorous-apple
Differential Revision: https://reviews.llvm.org/D43230
llvm-svn: 325113
Diffstat (limited to 'clang-tools-extra/clangd/ClangdLSPServer.cpp')
| -rw-r--r-- | clang-tools-extra/clangd/ClangdLSPServer.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp index 50dbbce89ad..3099a638941 100644 --- a/clang-tools-extra/clangd/ClangdLSPServer.cpp +++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp @@ -275,16 +275,13 @@ void ClangdLSPServer::onCodeAction(CodeActionParams &Params) { } void ClangdLSPServer::onCompletion(TextDocumentPositionParams &Params) { - Server.codeComplete(Params.textDocument.uri.file, - Position{Params.position.line, Params.position.character}, - CCOpts, + Server.codeComplete(Params.textDocument.uri.file, Params.position, CCOpts, [](Tagged<CompletionList> List) { reply(List.Value); }); } void ClangdLSPServer::onSignatureHelp(TextDocumentPositionParams &Params) { - auto SignatureHelp = Server.signatureHelp( - Params.textDocument.uri.file, - Position{Params.position.line, Params.position.character}); + auto SignatureHelp = + Server.signatureHelp(Params.textDocument.uri.file, Params.position); if (!SignatureHelp) return replyError(ErrorCode::InvalidParams, llvm::toString(SignatureHelp.takeError())); @@ -292,9 +289,8 @@ void ClangdLSPServer::onSignatureHelp(TextDocumentPositionParams &Params) { } void ClangdLSPServer::onGoToDefinition(TextDocumentPositionParams &Params) { - auto Items = Server.findDefinitions( - Params.textDocument.uri.file, - Position{Params.position.line, Params.position.character}); + auto Items = + Server.findDefinitions(Params.textDocument.uri.file, Params.position); if (!Items) return replyError(ErrorCode::InvalidParams, llvm::toString(Items.takeError())); @@ -307,9 +303,8 @@ void ClangdLSPServer::onSwitchSourceHeader(TextDocumentIdentifier &Params) { } void ClangdLSPServer::onDocumentHighlight(TextDocumentPositionParams &Params) { - auto Highlights = Server.findDocumentHighlights( - Params.textDocument.uri.file, - Position{Params.position.line, Params.position.character}); + auto Highlights = Server.findDocumentHighlights(Params.textDocument.uri.file, + Params.position); if (!Highlights) { replyError(ErrorCode::InternalError, |

