Skip to content

[clangd] Fix JSON conversion for symbol tags #84747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

ckandeler
Copy link
Member

The wrong constructor of json::Value got called, making every tag an array instead of a number.

The wrong constructor of json::Value got called, making every tag an
array instead of a number.
@llvmbot
Copy link
Member

llvmbot commented Mar 11, 2024

@llvm/pr-subscribers-clangd

@llvm/pr-subscribers-clang-tools-extra

Author: Christian Kandeler (ckandeler)

Changes

The wrong constructor of json::Value got called, making every tag an array instead of a number.


Full diff: https://github.com/llvm/llvm-project/pull/84747.diff

1 Files Affected:

  • (modified) clang-tools-extra/clangd/Protocol.cpp (+1-1)
diff --git a/clang-tools-extra/clangd/Protocol.cpp b/clang-tools-extra/clangd/Protocol.cpp
index 8aa18bb0058abe..c6553e00dcae28 100644
--- a/clang-tools-extra/clangd/Protocol.cpp
+++ b/clang-tools-extra/clangd/Protocol.cpp
@@ -1412,7 +1412,7 @@ bool fromJSON(const llvm::json::Value &Params, ReferenceParams &R,
 }
 
 llvm::json::Value toJSON(SymbolTag Tag) {
-  return llvm::json::Value{static_cast<int>(Tag)};
+  return llvm::json::Value(static_cast<int>(Tag));
 }
 
 llvm::json::Value toJSON(const CallHierarchyItem &I) {

@sam-mccall sam-mccall merged commit 9b2386e into llvm:main Mar 11, 2024
@sam-mccall
Copy link
Collaborator

Thanks! (And sorry, that json::Value constructor is my fault too...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants