This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Limit completion results.
ClosedPublic

Authored by hokein on Jan 24 2018, 8:05 AM.

Details

Summary
  • truncate symbols from static/dynamic index to the limited number

(which would save lots of cost in constructing the merged symbols).

  • add an CLI option allowing to limit the number of returned completion results.

(default to 100)

Diff Detail

Repository
rL LLVM

Event Timeline

hokein created this revision.Jan 24 2018, 8:05 AM
sammccall accepted this revision.Jan 24 2018, 8:10 AM

Thank you!

clangd/tool/ClangdMain.cpp
128 ↗(On Diff #131271)

nit: our flag names are generally too long, I think. is completion-limit enough?

131 ↗(On Diff #131271)

I think we probably want to keep the default at 0 for now. I'm fine with 100 personally, but talk to Ilya if you want to change the default :-)

This shouldn't be hidden.

224 ↗(On Diff #131271)

nit: whitespace

unittests/clangd/CodeCompleteTests.cpp
541 ↗(On Diff #131271)

also assert Results.isIncomplete

This revision is now accepted and ready to land.Jan 24 2018, 8:10 AM
hokein updated this revision to Diff 131394.Jan 25 2018, 12:59 AM
hokein marked 4 inline comments as done.

Address review comments.

clangd/tool/ClangdMain.cpp
131 ↗(On Diff #131271)

Let's keep the original behavior at the moment.

This revision was automatically updated to reflect the committed changes.