[clangd] Add `score` extension to workspace/symbol response.
authorSam McCall <sam.mccall@gmail.com>
Mon, 5 Oct 2020 19:41:35 +0000 (21:41 +0200)
committerSam McCall <sam.mccall@gmail.com>
Tue, 6 Oct 2020 09:57:38 +0000 (11:57 +0200)
commit3cb1220709fa556d4d29ce0e25fd30a16895ae24
tree9ca36bdda52278ef5b4f0c65689ef5c69936db66
parent27f3d51b4ef9bf4dc9cfeed88f66fcfc7ee99ee9
[clangd] Add `score` extension to workspace/symbol response.

The protocol doesn't really incorporate ranking.
As with code completion, most clients respect what the server sends, but
VSCode re-ranks items, with predictable results.
See https://github.com/clangd/vscode-clangd/issues/81

There's no filterText field so we may be unable to construct a good workaround.
But expose the score so we may be able to do this on the client in future.

Differential Revision: https://reviews.llvm.org/D88844
clang-tools-extra/clangd/FindSymbols.cpp
clang-tools-extra/clangd/Protocol.cpp
clang-tools-extra/clangd/Protocol.h
clang-tools-extra/clangd/test/symbols.test