This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Sema ranking tweaks: downrank keywords and injected names.
ClosedPublic

Authored by sammccall on Jun 20 2018, 7:43 AM.

Details

Summary

Injected names being ranked too high was just a bug.
The high boost for keywords was intended, but was too much given how useless
keywords are. We should probably boost them on a case-by-case basis eventually.

Before:

After:

Diff Detail

Repository
rL LLVM

Event Timeline

sammccall created this revision.Jun 20 2018, 7:43 AM
hokein accepted this revision.Jun 27 2018, 1:27 AM

The code looks good to me.

It'd be nicer if you can put ranking screenshots (before vs after) in the patch summary.

clangd/Quality.cpp
160 ↗(On Diff #152088)

I'm curious on how we choose these magic numbers, by experience?

This revision is now accepted and ready to land.Jun 27 2018, 1:27 AM
sammccall edited the summary of this revision. (Show Details)Jun 27 2018, 2:09 AM

Added before/after

clangd/Quality.cpp
160 ↗(On Diff #152088)

Yeah, the constraint being satisfied here is boost(Keyword) < boost(FunctionScope) * boost(Variable)

This revision was automatically updated to reflect the committed changes.