Index: clang-tools-extra/clangd/Protocol.cpp =================================================================== --- clang-tools-extra/clangd/Protocol.cpp +++ clang-tools-extra/clangd/Protocol.cpp @@ -895,8 +895,16 @@ {"range", S.range}, {"selectionRange", S.selectionRange}}; - if (!S.detail.empty()) + if (!S.detail.empty()) { + if (S.kind == SymbolKind::Method || S.kind == SymbolKind::Function) { + llvm::StringRef Detail{S.detail}; + const auto Start = Detail.find_first_of('('); + const auto End = Detail.find_last_of(')'); + const auto Distance = End - Start; + Result["name"] = S.name + Detail.substr(Start, Distance).str() + ')'; + } Result["detail"] = S.detail; + } if (!S.children.empty()) Result["children"] = S.children; if (S.deprecated) Index: clang-tools-extra/clangd/test/symbols.test =================================================================== --- clang-tools-extra/clangd/test/symbols.test +++ clang-tools-extra/clangd/test/symbols.test @@ -36,7 +36,7 @@ # CHECK-NEXT: { # CHECK-NEXT: "detail": "void ()", # CHECK-NEXT: "kind": 12, -# CHECK-NEXT: "name": "foo", +# CHECK-NEXT: "name": "foo()", # CHECK-NEXT: "range": { # CHECK-NEXT: "end": { # CHECK-NEXT: "character": {{.*}}, @@ -61,7 +61,7 @@ # CHECK-NEXT: { # CHECK-NEXT: "detail": "int ()", # CHECK-NEXT: "kind": 12, -# CHECK-NEXT: "name": "main", +# CHECK-NEXT: "name": "main()", # CHECK-NEXT: "range": { # CHECK-NEXT: "end": { # CHECK-NEXT: "character": {{.*}},