This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Add a flag for setting isIncomplete flag true in all responses
AbandonedPublic

Authored by kbobyrev on Feb 13 2020, 6:59 AM.

Details

Reviewers
None
Summary

To simplify re-ranking the code completion results, some clients might
want to mimic receiving the completion lists which are always incomplete.

Diff Detail

Event Timeline

kbobyrev created this revision.Feb 13 2020, 6:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 13 2020, 6:59 AM

some drive-by comments:

if this is a client-specific option, wouldn't it be equally hard for client to just set this in the LSP layer, instead of telling clangd to do that?

by looking at the current patch, it rather seems like a user-specific option, which will help users who want to prevent their editors from re-ranking results.

clang-tools-extra/clangd/ClangdLSPServer.cpp
986

nit: ClangdServerOpts.AlwaysIncomplete || List->HasMore

clang-tools-extra/clangd/tool/ClangdMain.cpp
405 ↗(On Diff #244424)

if we want clients to set it wouldn't it be better to make it an initialization option instead?

kbobyrev updated this revision to Diff 244618.Feb 14 2020, 4:19 AM
kbobyrev marked 2 inline comments as done.

Address the review comments.

kbobyrev edited reviewers, added: kadircet; removed: sammccall.Feb 14 2020, 4:20 AM
kbobyrev added a subscriber: sammccall.
kbobyrev edited reviewers, added: sammccall; removed: kadircet.Feb 14 2020, 4:34 AM
kbobyrev removed subscribers: sammccall, ilya-biryukov.

The idea is this is an easy option for the user to work-around editors that do client-side filtering badly (everyone lets you add flags).
But as mentioned offline, I don't think we actually have an example of an editor this fixes (I think it fixes neither vscode nor coc.nvim). So in that case we shouldn't land it.

kbobyrev abandoned this revision.Feb 14 2020, 10:25 AM

Okay, makes sense!

kbobyrev removed rG LLVM Github Monorepo as the repository for this revision.
kbobyrev removed a project: Restricted Project.
kbobyrev removed subscribers: MaskRay, jkorous, arphaman and 3 others.