This fixes https://github.com/clangd/clangd/issues/60
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 33655 Build 33654: arc lint + arc unit
Event Timeline
Could you also add a lit test for the case you mentioned in the github issue?
You can find pointers in clang-tools-extra/clangd/test/diagnostics.test and clang-tools-extra/clangd/test/fixits-codeaction.test
clang-tools-extra/clangd/Protocol.h | ||
---|---|---|
652 | could you rather put code after range and message so that we somewhat preserve the ordering. I am not sure if it is used anywhere but looks like we are using an ordered container(std::map) to store these. |
The fix actually broke another lit test, because in that test the client was not sending the diagnostic's code back in the codeAction request, resulting in a mismatch with the new comparison function.
I think a real client could potentially could this too (not send the code back), so I revised the fix to address this case, by only using the code in the comparison if it's present in both objects.
Also added the requested new lit test.
LGTM with one more test case request. Thanks!
clang-tools-extra/clangd/test/fixits-duplication.test | ||
---|---|---|
45 | could you also add another codeAction request with one of the codes missing? |
could you rather put code after range and message so that we somewhat preserve the ordering. I am not sure if it is used anywhere but looks like we are using an ordered container(std::map) to store these.