This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Make a.k.a printing configurable.
ClosedPublic

Authored by lh123 on Nov 27 2021, 4:03 AM.

Details

Summary

Currently, a.k.a printing is closed by default.

Diff Detail

Event Timeline

lh123 created this revision.Nov 27 2021, 4:03 AM
lh123 requested review of this revision.Nov 27 2021, 4:03 AM
lh123 updated this revision to Diff 390158.Nov 27 2021, 5:04 AM
lh123 retitled this revision from [clangd] Add a way to enable a.k.a print through config to [clangd] Make a.k.a printing configurable..

fix testcase.

nridge added a subscriber: nridge.Nov 29 2021, 1:35 PM
lh123 updated this revision to Diff 391546.Dec 2 2021, 10:09 PM

rebase to head.

sammccall accepted this revision.Dec 7 2021, 4:19 AM

(Sorry about all the boilerplate for adding config, I think I should probably add some tablegen magic to cover everything except Config.h)

clang-tools-extra/clangd/ConfigFragment.h
271

One question is whether the setting should control hover specifically, or whether it covers "in places we print types" more generally. But it doesn't seem likely we'll make this configurable for diagnostics, and I don't have other examples. Most of our settings are per-feature. So I think this is right as it is.

273

I'd call this ShowAKA

(verb before its object; "show" is a little less jargony)

clang-tools-extra/clangd/unittests/HoverTests.cpp
1

we should also add at least one test with it disabled

This revision is now accepted and ready to land.Dec 7 2021, 4:19 AM
lh123 marked an inline comment as done.Dec 7 2021, 9:00 AM
lh123 added inline comments.
clang-tools-extra/clangd/ConfigFragment.h
271

In the future, the AKA type can also be displayed in the signature help, but I don't know the best place for this option.(for now, it should be fine to put this setting in hover)

kadircet added inline comments.Dec 7 2021, 9:29 AM
clang-tools-extra/clangd/ConfigFragment.h
271

we've got a Style section actually, which might be more suitable for extensibility but I am also afraid of pushing ourselves into a corner by putting too much meaning into a boolean flag.

maybe we should just go with a command line flag until we figure out what to do here (as it's less invasive)?

sammccall added inline comments.Dec 7 2021, 11:14 AM
clang-tools-extra/clangd/ConfigFragment.h
271

I thought about style but the idea is that reflects coding style of the project, where this is really more of a user preference.

I'm a little skeptical whether we'll want this in sig help/completion (vs just being smarter about whether to desugar)

Command line flag is tempting but annoying to wire up. My favorite is probably what we have here

SG if you also considered the style block. I suppose the risks of having
this in a feature-specific block is much lower.

This revision was automatically updated to reflect the committed changes.
lh123 marked 3 inline comments as done.