Skip to content

Commit 7255342

Browse files
unhappychoiceclaude
andcommitted
fix: correct Kotlin comment node kind and resolve clippy warnings
- Replace "multiline_comment" with "block_comment" in Kotlin parser - Add new() methods to CompressedFileStorage and FileStorage - Implement Default trait for FileStorage - Update snapshot test for Kotlin comprehensive extraction 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 03d2572 commit 7255342

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

src/domain/models/languages/kotlin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ impl Language for Kotlin {
2626

2727
fn is_valid_comment_node(&self, node: tree_sitter::Node) -> bool {
2828
let node_kind = node.kind();
29-
node_kind == "line_comment" || node_kind == "multiline_comment"
29+
node_kind == "line_comment" || node_kind == "block_comment"
3030
}
3131
}

src/domain/repositories/challenge_repository.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ impl ChallengeRepository {
3939

4040
Self {
4141
cache_dir,
42-
storage: CompressedFileStorage::default(),
42+
storage: CompressedFileStorage::new(),
4343
}
4444
}
4545

4646
pub fn with_cache_dir(cache_dir: PathBuf) -> Self {
4747
Self {
4848
cache_dir,
49-
storage: CompressedFileStorage::default(),
49+
storage: CompressedFileStorage::new(),
5050
}
5151
}
5252

src/infrastructure/storage/compressed_file_storage.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ mod real_impl {
1919
impl AppDataProvider for CompressedFileStorage {}
2020

2121
impl CompressedFileStorage {
22+
pub fn new() -> Self {
23+
Self
24+
}
25+
2226
/// Save compressed binary data to a file
2327
pub fn save<T: Serialize>(&self, file_path: &Path, data: &T) -> Result<()> {
2428
// Ensure parent directory exists
@@ -130,6 +134,10 @@ mod mock_impl {
130134
impl AppDataProvider for CompressedFileStorage {}
131135

132136
impl CompressedFileStorage {
137+
pub fn new() -> Self {
138+
Self::default()
139+
}
140+
133141
pub fn save<T: Serialize>(&self, file_path: &Path, data: &T) -> Result<()> {
134142
use flate2::{write::GzEncoder, Compression};
135143
use std::io::Write;

src/infrastructure/storage/file_storage.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ mod real_impl {
2020

2121
impl AppDataProvider for FileStorage {}
2222

23+
impl Default for FileStorage {
24+
fn default() -> Self {
25+
Self::new()
26+
}
27+
}
28+
2329
impl FileStorage {
2430
pub fn new() -> Self {
2531
Self

tests/integration/languages/snapshots/r#mod__integration__languages__extractor__test_kotlin_comprehensive_extraction.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ expression: "serde_json::to_string_pretty(&snapshot_data).unwrap()"
1111
1,
1212
16
1313
],
14+
[
15+
17,
16+
36
17+
],
1418
[
1519
64,
1620
77

0 commit comments

Comments
 (0)