Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
So, if my understanding is correct, this will make the whole bundle non-deprecated if at least one overload is not deprecated? This is probably an improvement over the existing behaviour. However, do we maybe want to split the bundles into deprecated and non-deprecated groups?
clang-tools-extra/clangd/CodeComplete.cpp | ||
---|---|---|
411 | The comment you added says "cleared" which means this should probably be |= rather than =, right? Also, I this looks longer but probably more readable at least for me. Also, the sources might be SemaResult, IndexResult or IdentifierResult, right? :( Otherwise could've been Completion.Deprecated |= C.SemaResult ? C.SemaResult->Availability == CXAvailability_Deprecated : C.IndexResult->Flags & Symbol::Deprecated; |
Whoops, lost this patch...
Yes, exactly.
However, do we maybe want to split the bundles into deprecated and non-deprecated groups?
I don't think splitting bundles over this is worthwhile.
- it's a distraction. The point of bundling is to hide some differences within an overload set, to let you see all the methods more clearly.
- the "deprecated" signal means "you don't want this". This is well-defined, and false, for a mixed bundle.
clang-tools-extra/clangd/CodeComplete.cpp | ||
---|---|---|
411 |
No, Deprecated *starts out true* and gets set to false (cleared) if we see any non-deprecated entry. (computes AND) Your version assumes it starts out false and sets it if we see any deprecated entry. (computes OR). I agree the OR version reads better - it's wrong though :-) |
I see, thank you very much for the explanation!
clang-tools-extra/clangd/CodeComplete.cpp | ||
---|---|---|
411 | Ahh, okay, makes sense, thank you! Nit: I think the version I suggested (with fixes |= vs =) is somewhat easier to read and doesn't take much more space. |
clang-tools-extra/clangd/CodeComplete.cpp | ||
---|---|---|
411 | Done, though with &= instead of = otherwise the logic is subtly different (the second clobbers the first). |
The comment you added says "cleared" which means this should probably be |= rather than =, right?
Also, I this looks longer but probably more readable at least for me.
Also, the sources might be SemaResult, IndexResult or IdentifierResult, right? :( Otherwise could've been Completion.Deprecated |= C.SemaResult ? C.SemaResult->Availability == CXAvailability_Deprecated : C.IndexResult->Flags & Symbol::Deprecated;