Page MenuHomePhabricator

[clangd] Expose Code Completion score to the client
ClosedPublic

Authored by kbobyrev on Feb 13 2020, 5:06 AM.

Details

Summary

Make it possible for the client to adjust the ranking by using the score Clangd
calculates for the completion items.

Diff Detail

Event Timeline

kbobyrev created this revision.Feb 13 2020, 5:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 13 2020, 5:06 AM
kbobyrev updated this revision to Diff 244402.Feb 13 2020, 5:25 AM

Replace actual scores with regex for stability.

sammccall accepted this revision.Feb 13 2020, 5:27 AM
sammccall added inline comments.
clang-tools-extra/clangd/Protocol.h
1100

/// This is a clangd extension.

clang-tools-extra/clangd/test/completion-auto-trigger.test
27

let's not include the value (note we don't in sortText either, which contains the encoded float)

Use {{.*}}

This revision is now accepted and ready to land.Feb 13 2020, 5:27 AM
kbobyrev updated this revision to Diff 244403.Feb 13 2020, 5:27 AM

Replace one instance of hardcoded score missed in the previous update.

sammccall added inline comments.Feb 13 2020, 5:28 AM
clang-tools-extra/clangd/test/protocol.test
42

oops, raced with you...

you missed some :-)
also I'd just use {{.*}} for readability, up to you though

kbobyrev updated this revision to Diff 244412.Feb 13 2020, 5:58 AM
kbobyrev marked 3 inline comments as done.

Make a note that score is Clangd extension.

This revision was automatically updated to reflect the committed changes.