This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Add `score` extension to workspace/symbol response.
ClosedPublic

Authored by sammccall on Oct 5 2020, 12:43 PM.

Details

Summary

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.

Diff Detail

Event Timeline

sammccall created this revision.Oct 5 2020, 12:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 5 2020, 12:43 PM
sammccall requested review of this revision.Oct 5 2020, 12:43 PM
kadircet accepted this revision.Oct 6 2020, 1:14 AM
kadircet added inline comments.
clang-tools-extra/clangd/FindSymbols.cpp
125

nit: maybe add a comment here too, explaining why we factor-out NameMatch. It wasn't obivous until i've read the comment below.

This revision is now accepted and ready to land.Oct 6 2020, 1:14 AM
This revision was landed with ongoing or failed builds.Oct 6 2020, 2:57 AM
This revision was automatically updated to reflect the committed changes.