I couldn't quite bring myself to make Cancellation depend on LSP ErrorCode.
Magic numbers instead...
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/JSONTransport.cpp | ||
---|---|---|
28 | Sadly this is UB if the value isn't an element of the enum (or in its range, or something). Whereas casting the cases leaves the code valid for arbitrary integers. |
Maybe static_cast<ErrorCode>(C.Reason) instead of casting cases.
I know the reason is not necessarily LSP specific, but we seem to be defaulting to ErrorCode::RequestCancelled anyways.