This is going to be needed to test e.g. diagnostics regeneration on
didSave where files changed on disk. Coordinating such changes is too
hard in lit tests.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
It seems fairly likely that this is a big complicated thing we end up using for 1 or 2 tests that are too hard to test with lit but can't be tested at a lower level than ClangdLSPServer.
Suggestions on how to make it more lightweight would be welcome!
LGTM, mostly nits.
Unfortunately I don't see any way to make it simpler :/
clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp | ||
---|---|---|
105 | nit: move this to top of the file | |
clang-tools-extra/clangd/unittests/LSPClient.cpp | ||
66 | put methods before fields | |
69 | i think logging errors here could help with debugging. | |
72 | nit: static_cast | |
100 | this check should happen before accessing Actions.front | |
107 | put public before private | |
158 | ah, the !Action check for stop now makes sense :D maybe get rid of the Stop flag inside transportimpl and say an empty action terminates the loop or make this invoke a T->stop(); which sets the flag | |
198 | URI is not an optional field, so shouldn't !U -> ADD_FAILURE() ? | |
200 | again diagnostics is not optional | |
clang-tools-extra/clangd/unittests/LSPClient.h | ||
45 | nit: put it before members, also some comments about "multiple call is failure" might be nice |
Address review comments
clang-tools-extra/clangd/unittests/LSPClient.cpp | ||
---|---|---|
66 | Done - I don't care much, but curious where this guideline comes from? | |
69 | Errors don't have bodies, the mesasge is already logged by clangdlspserver. Added a comment. |
clang-tools-extra/clangd/unittests/LSPClient.cpp | ||
---|---|---|
66 | i believe most of the code in LLVM puts the members at the top of the class. but my impression was in clangd code we tend to put members at the very bottom, hence i suggested that. personally i actually find having members at the top more useful. |
nit: move this to top of the file