chore(deps): migrate from eventide to kotatsu - #428
Conversation
The eventide library was renamed to kotatsu (clice-io/kotatsu) with a
broad rename of CMake identifiers, namespaces, header paths, and a few
module reorgs. Align clice to the new names and layout.
- FetchContent dep: eventide -> kotatsu
- CMake options: ETD_* -> KOTA_*, ETD_SERDE_* -> KOTA_CODEC_*
- CMake targets: eventide::{ipc::lsp, serde::toml, deco, zest}
-> kota::{ipc::lsp, codec::toml, deco, zest}
- Namespaces: eventide:: -> kota::, eventide::serde:: -> kota::codec::,
eventide::refl:: -> kota::meta::. Short `et` alias is dropped; all
usages now reference kota:: directly.
- Headers: eventide/* -> kota/*, with renames:
common/ -> support/, reflection/ -> meta/, serde/ -> codec/,
serde/serde/raw_value.h -> codec/raw_value.h,
ipc/json_codec.h -> ipc/codec/json.h.
- Include kota/ipc/codec/{json,bincode}.h where JsonPeer/BincodePeer is
used (kotatsu moved those aliases out of ipc/peer.h into the
codec-specific headers).
- .clang-format: add kota to the third-party include-group regex.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis pull request migrates the entire codebase from the Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (5)
cmake/package.cmake (1)
42-56: Consider pinningkotatsuto a commit or tag.
GIT_TAG mainleaves the build subject to upstream drift and makes bisection harder. Since the PR notes a specific dependency on clice-io/kotatsu#110, pinning to that merge commit (or a release tag) would make builds reproducible without changing behavior today.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cmake/package.cmake` around lines 42 - 56, The FetchContent entry for kotatsu currently uses GIT_TAG main which allows upstream drift; replace the GIT_TAG main line with a pinned commit hash or explicit release tag (the merge commit for clice-io/kotatsu#110 or a released tag) so builds are reproducible — e.g. update the kotatsu block (the lines that include kotatsu, GIT_REPOSITORY, GIT_TAG main, GIT_SHALLOW TRUE) to use the chosen commit hash/tag instead of "main" and keep FetchContent_MakeAvailable(kotatsu spdlog croaring flatbuffers) as-is.src/syntax/dependency_graph.cpp (1)
793-801: Nit: adjacent string literals look incidental.The format string is split as
"... next={} " "prefetch={}", which concatenates fine (7 placeholders, 7 args). It's unrelated to this migration, but if you happen to touch this line again, consider collapsing it into a single literal for readability.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/syntax/dependency_graph.cpp` around lines 793 - 801, The LOG_INFO call currently uses two adjacent string literals ("... next={} " "prefetch={}") which accidentally splits the format string; update the LOG_INFO invocation (the format string in the LOG_INFO call near wave_num/current_wave/prefetch_tasks) to use a single contiguous literal for readability (e.g., collapse into "... next={} prefetch={}") while keeping the same placeholders and arguments (wave_num, current_wave.size(), p1, p2, p3, next_wave.size(), prefetch_tasks.size()).src/server/worker_common.h (1)
10-13: LGTM —to_rawmigrated cleanly.The three new kota includes match the types used, and the template now returns
kota::codec::RawValueviakota::codec::json::to_json<kota::ipc::lsp_config>with the same"null"fallback as before. The mirror copy insrc/server/master_server.cpp(L33-37) is consistent.Side note (not blocking): the
to_rawhelper is duplicated between this header andmaster_server.cpp. Since this header is included by bothstateful_worker.cppandstateless_worker.cpp,master_server.cppcould also just includeworker_common.hand drop its static copy — worth a small follow-up cleanup if you want to consolidate.Also applies to: 40-42
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/server/worker_common.h` around lines 10 - 13, The to_raw helper (which returns kota::codec::RawValue via kota::codec::json::to_json<kota::ipc::lsp_config> with the "null" fallback) is duplicated in this header and in master_server.cpp; remove the static copy in master_server.cpp and have master_server.cpp include worker_common.h instead so there is a single to_raw implementation (ensure includes for kota::codec::json::serializer, kota::codec::raw_value and kota::ipc::codec::json remain available where to_raw is used).src/server/compiler.cpp (2)
26-26: Rename theserde_rawalias to reflect the new codec terminology.Since this PR renames
eventide::serde→kota::codecproject-wide, carrying aserde_rawalias forward is misleading to readers. Consider renaming (e.g.raw_value/codec_raw) for consistency with the new naming.✏️ Proposed rename
-using serde_raw = kota::codec::RawValue; +using raw_value = kota::codec::RawValue;(All
serde_raw{...}usages below would need to be updated to match.)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/server/compiler.cpp` at line 26, Rename the misleading alias serde_raw to a name matching the kota::codec terminology (e.g., raw_value) by changing the alias declaration using serde_raw = kota::codec::RawValue; to using raw_value = kota::codec::RawValue; and update all references of serde_raw throughout the codebase (including uses in src/server/compiler.cpp and any other files) to raw_value so the alias matches the new codec naming. Ensure you also update any comments or docstrings that mention serde_raw to reflect the new name.
897-913: Inline JSON serialization duplicatesworker_common.h::to_raw.Both completion branches here replicate exactly the body of
to_raw(fromsrc/server/worker_common.h) but fall back to"[]"instead of"null". Consider extendingto_rawto accept a fallback (or adding ato_raw_arrayhelper) so these two sites can call the shared helper — reducing duplication and keeping thelsp_configplumbing in one place.♻️ Sketch
// in worker_common.h template <typename T> inline kota::codec::RawValue to_raw(const T& value, std::string_view fallback = "null") { auto json = kota::codec::json::to_json<kota::ipc::lsp_config>(value); return kota::codec::RawValue{json ? std::move(*json) : std::string(fallback)}; }- auto json = kota::codec::json::to_json<kota::ipc::lsp_config>(items); - co_return serde_raw{json ? std::move(*json) : "[]"}; + co_return to_raw(items, "[]");🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/server/compiler.cpp` around lines 897 - 913, The two completion branches in compiler.cpp duplicate the JSON serialization logic found in worker_common.h; update the shared helper (either extend to_raw in worker_common.h to accept a fallback std::string_view or add a new to_raw_array helper) so it performs kota::codec::json::to_json<kota::ipc::lsp_config>(...) and returns a kota::codec::RawValue with the given fallback when json is null, then replace the duplicated blocks in the Completion and CompletionContext::Import branches to call the new helper (ensuring the Import branch uses fallback "[]") instead of inlining the serialization.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@cmake/package.cmake`:
- Around line 42-56: The FetchContent entry for kotatsu currently uses GIT_TAG
main which allows upstream drift; replace the GIT_TAG main line with a pinned
commit hash or explicit release tag (the merge commit for clice-io/kotatsu#110
or a released tag) so builds are reproducible — e.g. update the kotatsu block
(the lines that include kotatsu, GIT_REPOSITORY, GIT_TAG main, GIT_SHALLOW TRUE)
to use the chosen commit hash/tag instead of "main" and keep
FetchContent_MakeAvailable(kotatsu spdlog croaring flatbuffers) as-is.
In `@src/server/compiler.cpp`:
- Line 26: Rename the misleading alias serde_raw to a name matching the
kota::codec terminology (e.g., raw_value) by changing the alias declaration
using serde_raw = kota::codec::RawValue; to using raw_value =
kota::codec::RawValue; and update all references of serde_raw throughout the
codebase (including uses in src/server/compiler.cpp and any other files) to
raw_value so the alias matches the new codec naming. Ensure you also update any
comments or docstrings that mention serde_raw to reflect the new name.
- Around line 897-913: The two completion branches in compiler.cpp duplicate the
JSON serialization logic found in worker_common.h; update the shared helper
(either extend to_raw in worker_common.h to accept a fallback std::string_view
or add a new to_raw_array helper) so it performs
kota::codec::json::to_json<kota::ipc::lsp_config>(...) and returns a
kota::codec::RawValue with the given fallback when json is null, then replace
the duplicated blocks in the Completion and CompletionContext::Import branches
to call the new helper (ensuring the Import branch uses fallback "[]") instead
of inlining the serialization.
In `@src/server/worker_common.h`:
- Around line 10-13: The to_raw helper (which returns kota::codec::RawValue via
kota::codec::json::to_json<kota::ipc::lsp_config> with the "null" fallback) is
duplicated in this header and in master_server.cpp; remove the static copy in
master_server.cpp and have master_server.cpp include worker_common.h instead so
there is a single to_raw implementation (ensure includes for
kota::codec::json::serializer, kota::codec::raw_value and kota::ipc::codec::json
remain available where to_raw is used).
In `@src/syntax/dependency_graph.cpp`:
- Around line 793-801: The LOG_INFO call currently uses two adjacent string
literals ("... next={} " "prefetch={}") which accidentally splits the format
string; update the LOG_INFO invocation (the format string in the LOG_INFO call
near wave_num/current_wave/prefetch_tasks) to use a single contiguous literal
for readability (e.g., collapse into "... next={} prefetch={}") while keeping
the same placeholders and arguments (wave_num, current_wave.size(), p1, p2, p3,
next_wave.size(), prefetch_tasks.size()).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a046565d-754c-4477-924a-9c9b2d54871d
📒 Files selected for processing (46)
.clang-formatCMakeLists.txtbenchmarks/scan_benchmark.cppcmake/package.cmakedocs/en/architecture.mdsrc/clice.ccsrc/command/toolchain.cppsrc/feature/diagnostics.cppsrc/feature/feature.hsrc/server/compile_graph.cppsrc/server/compile_graph.hsrc/server/compiler.cppsrc/server/compiler.hsrc/server/config.cppsrc/server/indexer.cppsrc/server/indexer.hsrc/server/master_server.cppsrc/server/master_server.hsrc/server/protocol.hsrc/server/session.hsrc/server/stateful_worker.cppsrc/server/stateless_worker.cppsrc/server/worker_common.hsrc/server/worker_pool.cppsrc/server/worker_pool.hsrc/server/workspace.cppsrc/server/workspace.hsrc/support/format.hsrc/syntax/dependency_graph.cpptests/unit/feature/code_completion_tests.cpptests/unit/feature/document_link_tests.cpptests/unit/feature/document_symbol_tests.cpptests/unit/feature/folding_range_tests.cpptests/unit/feature/hover_tests.cpptests/unit/feature/inlay_hint_tests.cpptests/unit/feature/semantic_tokens_tests.cpptests/unit/feature/signature_help_tests.cpptests/unit/server/compile_graph_integration_tests.cpptests/unit/server/compile_graph_tests.cpptests/unit/server/module_worker_tests.cpptests/unit/server/pch_worker_tests.cpptests/unit/server/stateful_worker_tests.cpptests/unit/server/stateless_worker_tests.cpptests/unit/server/worker_test_helpers.htests/unit/test/test.htests/unit/unit_tests.cc
Summary
eventidedep was renamed to kotatsu with a broad rename of CMake identifiers, namespaces, header paths, and a few module reorgs (serde→codec,reflection→meta,common→support). Align clice to the new names.ETD_*→KOTA_*,ETD_SERDE_*→KOTA_CODEC_*), target names (eventide::{ipc::lsp,serde::toml,deco,zest}→kota::{ipc::lsp,codec::toml,deco,zest}).eventide::→kota::,eventide::serde::→kota::codec::,eventide::refl::→kota::meta::. The shortetalias is dropped — all usages now spellkota::directly.eventide/*→kota/*, including special casesserde/serde/raw_value.h→codec/raw_value.h,ipc/json_codec.h→ipc/codec/json.h,common/meta.h→support/type_traits.h,common/ranges.h→support/ranges.h.JsonPeer/BincodePeerout ofipc/peer.hinto the codec-specific headers; addedkota/ipc/codec/{json,bincode}.hincludes where those types are used.-Wall -Wextra -Werrorfrom transitively propagating out ofkota::project_options.Test plan
pixi run unit-test RelWithDebInfo— 518/518 pass (9 skipped, unchanged from main)pixi run integration-test RelWithDebInfo— 119/119 passpixi run smoke-test RelWithDebInfo— 2/2 passpixi run formatcleanNotes
tests/smoke/rapid_edit.jsonlwas intentionally left untouched: the embedded#include "eventide/..."strings are frozen snapshots of file contents the client sent at record time, not clice source.🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
eventidetokota, including async runtime, IPC transport, serialization codec, and metadata libraries.Refactor
kotanamespace and APIs throughout the codebase.