Details
- Reviewers
sammccall - Commits
- rGb5b2c81055cf: [clangd] Propagate data in diagnostics
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/Diagnostics.h | ||
---|---|---|
59 | Second sentence is confusing because of inverted sense. And really I don't think the reason is that we don't want to send extra data, but rather the fear that old clients will choke on it. If we're *not* afraid of that, i.e. we think they'll just drop it on the floor, then I don't think we should bother to feature-detect it just so *we* can drop it on the floor. | |
78 | Maybe call this OpaqueData or Data? | |
clang-tools-extra/clangd/Protocol.h | ||
851 | The array representation seems a bit awkward in practice: it's ~always going to have 1 element (or none), so it seems like unnecessary wrapping. This array prevents tweaks from clobbering each other but OTOH it means the data they read doesn't match the data they write. I think making data an Object and passing in a mutable ref to it will work fine in practice. |
clang-tools-extra/clangd/Diagnostics.h | ||
---|---|---|
59 | as discussed offline dropping this completely. since we don't really guard against adding "extra" properties to objects, and the worst that could happen is clangd won't surface a particular tweak on clients without support. |
clang-tools-extra/clangd/Diagnostics.h | ||
---|---|---|
78 | Hmm, you've replaced the json::Array with an array of objects :-) We don't really handle conflicts anyway, and I don't think having one tweak read another one's data out of this field is a real concern. | |
clang-tools-extra/clangd/Protocol.cpp | ||
615 | std::move is a fancy way to spell copy here, since Params is const. json::Value(*Data) (or can you just use mapOptOrNull?) | |
clang-tools-extra/clangd/Protocol.h | ||
413 | this is now unused | |
clang-tools-extra/clangd/refactor/Tweak.h | ||
71 | unrelated? |
clang-tools-extra/clangd/Diagnostics.h | ||
---|---|---|
78 | oops, that wasn't the intention. changed to llvm::json::Object. | |
clang-tools-extra/clangd/Protocol.cpp | ||
615 |
right.. dropped that.
we can't mapOptOrNull as fromJSON doesn't have output specializations for JSON types. i don't think it is worth having them (i think, they would actually be confusing). but if you think it's worth, maybe we can have some identity mapper specialization. | |
clang-tools-extra/clangd/refactor/Tweak.h | ||
71 | yeah this was supposed to be a separate change but forgot to strip this bit off.. |
Second sentence is confusing because of inverted sense. And really I don't think the reason is that we don't want to send extra data, but rather the fear that old clients will choke on it.
If we're *not* afraid of that, i.e. we think they'll just drop it on the floor, then I don't think we should bother to feature-detect it just so *we* can drop it on the floor.
Not sure how you feel about this, but it's pretty tempting to me...